-
Replied To a Post in Implementing own hashtable contains() method
What's the context for this? Are you extending Hashtable for your own purposes? Is this a complete new implementation of a hash table? Did you see that Hashtable is obsolete? … -
Replied To a Post in how to store JTree data hierarchically in mysql database from netbeans
What's wrong with that? Looks like sound advice to me (given that the type of the nodes has not been specified) -
Replied To a Post in Case problem integer or string?
1. Factorials of numbers like 1,000,000 are far far too large for ordinary int or long variables; you need the BigInteger class to hold them. BigInteger also has a toString … -
Replied To a Post in Outputting text with Formatting
That link is just for controlling layout by automatically inserting blanks - it is not a solution for using italics. -
Replied To a Post in Color Code Methods in Eclipse, Netbeans, or other IDE
In Netbeans if you highlight the opening bracket on any block (including method bodies) it also highlights the matching close bracket. But for real-life sized code in Eclipse or Netbeans … -
Replied To a Post in Outputting text with Formatting
How about writing your text as an HTML file. That's really easy. -
Marked Solved Status for Dice game crazier than usual!
Hi everyone, I've been taking a Intro to Java class this year and been enjoying it, I recently had a assignment which was a simple dice game, however I was … -
Replied To a Post in Looking to add an icon (with a catch!)
Without more info its hard to say, but ... The contents of the build folder are replaced every time you rebuild the project - you should never put anything there … -
Replied To a Post in Looking to add an icon (with a catch!)
I use that code in many programs without problems. Can you show the actual contents of your jar file (use any zip utility to open it)? -
Replied To a Post in Only one item in HashSet is being returned
returnString = " " + ((Item)iter.next()).getDescription(); discards any orevious data in returnString. How about returnString = returnString + " " + ((Item)iter.next()).getDescription(); top keep the existing values -
Replied To a Post in Why doesn't boolean variable work?
Line 69 ypu declare a new newEnergy boolean - looks like that may be masking class-level variable of the same name? -
Replied To a Post in Bluej
Post what you have done here and someone will help. Explain where you are getting stuck - more more info you give the better we can help. -
Replied To a Post in JFrame showing nothing.
+1 for spotting the "s" Here's an updated hint: Java names are case sensitive, and "Component" is not the same as "Components" -
Replied To a Post in JFrame showing nothing.
Exactly. It's not overriding because the superclass does not have a method called PaintComponent. Here's a hint: Java names are case sensitive. -
Replied To a Post in JFrame showing nothing.
This is why the @Overrride annotation was invented! If you prefix that annotation to your PaintComponent method you will discover that it doesn't override anything. Here's a hint: Java names … -
Replied To a Post in Recursion to make a Scholarly Neighborhood
This looks like a case of premature coding! Try writing the algorithm in simple pseudo-code, or even plain English. Until you have a clear statement of the algorithm there's no … -
Replied To a Post in Looking to add an icon (with a catch!)
Hi Pob, welcome back! You can use something along the lines of BufferedImage image = ImageIO.read(getClass().getResource("/images/xxx.png")); myMainWindow.setIconImage(image); wher /images is a folder in the same jar that the current class … -
Replied To a Post in loan records
That all depends on how your Loans/Members/Books etc are structured, not to mention what kind of user interface you want. DaniWeb Member Rules (which you agreed to when you signed … -
Replied To a Post in Drop and Inventory Search Commands Do Not Work
That's just an example of the kind of code you should use to print the variables at the point where you get the NPE. You were supposed to understand it, … -
Replied To a Post in help about weblogic deployement.....
It looks like you have your HwWorldClient class in a package called part1, and you have messed up the package naming or folder structure in some way. Have a read … -
Replied To a Post in Drop and Inventory Search Commands Do Not Work
Not brain surgery, just like any other print. eg System.out.println("anItem = " + anItem + " getName returned + "anItem.getName()); -
Replied To a Post in Drop and Inventory Search Commands Do Not Work
Step 1: Find out which variable or method return value is null on that line by printing each of them out. In particlual check whether `anItem.getName()` is returning null. -
Replied To a Post in graphic user interface
You just copy/pasted your assignment without even a moment taken to explain what help you need. That's highly disrepestectful to the many people who give their time to help others … -
Replied To a Post in JaR
Do you mean you want to protect your jar so it can't be decompiled? There's no perfect solution, but there are ways to make it more difficult. Google for **java … -
Replied To a Post in Can not initiate the type integer
You probably have got confused about how to use generics. You have defined type parameters for your class and named them "String" and "Integer". These names are hiding the classes … -
Replied To a Post in Datatype questions?
It's in the Java Language Specification - section 4.12.5 *Initial Values of Variables*. Beware - there are different answers for local variables -
Replied To a Post in Need help to with arrays and using methods
After a quick look I can't see an "index" variable defined that's in scope at line 52 (the one on line 29 is local to the getGrossSales method only). (And … -
Replied To a Post in A very noob question about creating an object
Postscript: Yes, `String s1 = "asdf";` is the way to do it. The other form is useless. But if you look on the web you will find one justification for … -
Replied To a Post in add an item to a jcombobox in alphabetical ascending order (sort)
I agree with what I think mKorbel is saying... much better to ORDER the records in your SELECT so they are sorted before you add them to the combo box -
Replied To a Post in add an item to a jcombobox in alphabetical ascending order (sort)
Maybe you can do it by coding your own ListModel then you can maintain the set of values sorted in alpha order. There are a number of list model classes … -
Replied To a Post in A very noob question about creating an object
This is one of those irrelevant technical questions that interviewers like to ask, but don't ever matter in practice: String s1 = "asdf"; String s2 = "asdf"; the compiler is … -
Replied To a Post in Random File Problem
You can keep reading data from the RandomAccessFile until it reaches end-of-file, at which point it throws an EOFException which you can catch to end the processing tidily. Or you … -
Marked Solved Status for Java file problem(record display)
Hey guys i am having a problem with displaying a single record out of a text file the code is not reaching the "if" function in the while loop of … -
Replied To a Post in How do I implement an item class in BlueJ?
items.add will only add an object of the Item class because that's how the list is defined. There is not, and has never been, and add method for lists that … -
Replied To a Post in Java file problem(record display)
You are reading from the "get" file while trying to control it with the Scanner's hasNext(). Because you never read from the Scanner it always hasNext - this is completely … -
Replied To a Post in How to reverse the characters in the words in a string?
Hello Chandan Please be more careful before posting if you do not want to look foolish... 1. This thread is 4 years old and already solved 2. You didn't read … -
Replied To a Post in Java Countdown freeze
You're doing very well for 14! And the best way to keep improving is to write this yourself. It's harder, yes, but that's how you learn. Keep trying and people … -
Replied To a Post in How do I implement an item class in BlueJ?
Its better... inside the method you need to add that Item to the items list -
Replied To a Post in Java Countdown freeze
Everything to do with Swing (eg painting the screen, running actionPerformed methods) happens on a single thread - the "Event Dispatch Thread", or "EDT", or "Swing thread". That means that … -
Replied To a Post in How do I implement an item class in BlueJ?
Sorry, my remote mind reader is offline today, otherwize I would have immediately known about that. :) In that case just straight to the last line of my previous post -
Replied To a Post in Help with Pascal's Triangle using recursive method
It would help if you explained what values you expect and exactly what "incorrect" values you are getting. -
Replied To a Post in How do I implement an item class in BlueJ?
You haven't done anything to implement an Items class. That would be some code that begins class Item { // variables for description and weight // contructor // etc } … -
Replied To a Post in Need help to with arrays and using methods
You can't just throw code into a class definition like that - executable statements need to be inside a method. The comments in the main methods are a good start. … -
Replied To a Post in Calculating Standard Deviation using Arrays
In the code you posted above the inputs are NOT stored in the array. The array salaries is created on line 9 and its values are used on line 25, … -
Replied To a Post in Calculating Standard Deviation using Arrays
see my previous posts - did you store the data into the array? -
Replied To a Post in Calculating Standard Deviation using Arrays
That's still not enough information. If the result is wrong: (1) what is it? (2) what should it be? ps: see my previous post - did you store the data … -
Replied To a Post in Calculating Standard Deviation using Arrays
"Didn't work" - you mean the program wouldn't execute? Please be very specific about what errors you are getting (eg complete error messages or actual vs expected results). That latest … -
Replied To a Post in Calculating Standard Deviation using Arrays
Line 25 you divide the running total of "Var" by the number of salaries on every pass of the loop. I think that's wtrong - you should compute the sum … -
Replied To a Post in Accessing local variable
(I took a quick look at the various classes and threads and decided not to worry about them. Presumably this is an arbitrary complex Thread test kind of exercise, because … -
Replied To a Post in Accessing local variable
1. Pass the instance of the desktop pane as a aparameter to the constructors of eveything that needs it or 2. Write a public static method in the server class …
The End.