Forum: Java 1 Day Ago |
| Replies: 1 Views: 86 This is going to sound stupid but did you try to open it as plain text... like in wordpad? (Or you can do so in other editors). And what is the file extension? Like .txt for example or .java |
Forum: Java 1 Day Ago |
| Replies: 3 Views: 110 Read the rules pertaining to "we only give homework help to those who show effort", then come back and post something that shows effort. And no, it does not matter whether this is homework or not.... |
Forum: Java 1 Day Ago |
| Replies: 4 Views: 119 Your program isn't going to work. In your method celciusToFarenheit, you tried to compare with "if degree == c". However, if you look at this link... |
Forum: Java 1 Day Ago |
| Replies: 2 Views: 80 Your error indicates that you attempted to parse an integer at line 128 of your program (which is correct: it says Integer.parseInt(input)). However, the program was unable to parse an int, because... |
Forum: Java 1 Day Ago |
| Replies: 5 Views: 151 For specific components see here: http://java.sun.com/docs/books/tutorial/uiswing/components/index.html
(for example, if you want to use a button in your app, look there to see how, or if you want... |
Forum: Java 1 Day Ago |
| Replies: 3 Views: 125 Both pieces of code say they work above the code. Which one doesn't work? The second one? And can you please fix your bracketing, I can't tell which brackets go with what. The brackets should be... |
Forum: Java 2 Days Ago |
| Replies: 7 Views: 152 "I am no longer able to parse the string for input into text..."
Huh? The JTextField class has a getText method. If you call myJTextField.getText() it will return a String. "Text" and "a String"... |
Forum: Java 2 Days Ago |
| Replies: 2 Views: 181 Did you even look at his code? The problem is obviously with the way he is reading in the text file.
@OP:
Scanner's next() method reads in input between the delimiter pattern, which by default... |
Forum: Java 2 Days Ago |
| Replies: 5 Views: 139 As for S.o.S's reply, you would expect it to infinitely loop, since you want to continuously check the file for updates. In other words it is supposed to infinitely loop so I don't see why you have... |
Forum: Java 2 Days Ago |
| Replies: 11 Views: 223 You should only extend a class if you need to add functionality to the class (or modify the class's functionality so that it does something different). I doubt that you need to do either of those... |
Forum: Java 2 Days Ago |
| Replies: 7 Views: 152 Post your best shot at doing this and I'll help. P.S. your code you already posted doesn't make sense; why would you say do... while(false)? That's only going to do something once, and if you want to... |
Forum: Java 2 Days Ago |
| Replies: 2 Views: 119 Are you trying to manually do a character by character search to match words? That is a mistake. Technically it could work but the amount of effort would be enormous and fruitless. I see that your... |
Forum: Java 4 Days Ago |
| Replies: 7 Views: 238 And also make sure to read about Classes in Java and Objects in Java. int, double, float, boolean, long, short, etc can not use method invocations ( like someInt.someMethod() ) because they are not... |
Forum: Java 7 Days Ago |
| Replies: 6 Views: 251 SWT was created for faster native widgets - it is faster because it uses the OS's native tools to draw the widgets, essentially. However, Swing should be plenty fast for most any purposes, and I... |
Forum: Java 7 Days Ago |
| Replies: 2 Views: 165 So. . are you simulating this process by creating threads on your local machine? Or are you actually using multiple machines and communicating with some master-server that acts to combine the results... |
Forum: Java 9 Days Ago |
| Replies: 5 Views: 261 No, I don't think there are non-trivial ways to do it with a standard grading system, other than the obvious ways which have been listed in this thread already. I don't understand the system you... |
Forum: Java 9 Days Ago |
| Replies: 2 Views: 194 It sounds more logical the way you have it - for example, to have the game class keep a list of what Objects are currently showing on screen, then when the player wants to attack, you can call... |
Forum: Java 14 Days Ago |
| Replies: 2 Views: 373 www.eclipse.org
www.netbeans.org (or is it com?)
google |
Forum: Java 16 Days Ago |
| Replies: 5 Views: 199 The StringTokenizer class documentation says its use is discouraged in new code and to use String class's split method instead.
And you cannot cause a String to be evaluated as if it was a piece... |
Forum: Java 16 Days Ago |
| Replies: 1 Views: 188 If you have a file full of ints then you would just use
while(scanner.hasNextInt())
You would not use scanner.hasNext() and then the if statement, that is an extra unnecessary step. You could... |
Forum: Java 16 Days Ago |
| Replies: 7 Views: 337 Your LoadStudents method doesn't make sense to me. You said while(s.hasNextLine()) but you never read anything in, so I'd think that would be an infinite loop. Additionally, you kept adding a new... |
Forum: Java 16 Days Ago |
| Replies: 2 Views: 191 There is no reason you'd ever pass "this" as an argument. "this" just refers to the Object of the classtype that you are currently in. So if your class name is Car, and you say "this." anywhere... |
Forum: Java 19 Days Ago |
| Replies: 7 Views: 480 If you use Java's built in Stack class and Queue class, you can simply call the appropriate methods to add the items on and take them off. For both of them, to add an item on, you probably just use... |
Forum: Java 20 Days Ago |
| Replies: 7 Views: 480 abccba
if you add each letter in order to the stack and the queue, here is the final stack and queue (in the order they would be popped off)
1. abccba
2. abccba
But looking at something... |
Forum: Java 20 Days Ago |
| Replies: 1 Views: 228 I haven't worked with Applets, but I think they work the same way as Swing basically? (Edit: confirmed - one whole point of JApplet is that it works with Swing). Use a JPanel or whatever the standard... |
Forum: Java 22 Days Ago |
| Replies: 2 Views: 144 Post your relevant code and tell us what part you're having trouble with. If your problem is not knowing enough about Timer and Threads, then read google. We'll be happy to help you with specific... |
Forum: Java 22 Days Ago |
| Replies: 2 Views: 257 In your PM, you asked "where should I implement the check condition". Typically do not PM daniweb members, keep questions to the threads. But I will answer anyway.
After each turn, you will need... |
Forum: Java 22 Days Ago |
| Replies: 2 Views: 410 http://www.csee.umbc.edu/courses/undergraduate/341/fall08/projects/proj5/HuffmanExplanation.html
That article explains the entire process, in detail, and it is the only resource needed to... |
Forum: Java 23 Days Ago |
| Replies: 2 Views: 257 Check is extremely simple actually. If any piece can currently move to the king's position, then the king is in check. Since you already have to implement the ability to allow players to move any... |
Forum: Java 23 Days Ago |
| Replies: 7 Views: 183 Yes but what is the close method supposed to do? |
Forum: Java 23 Days Ago |
| Replies: 9 Views: 246 Sorry, I just edited my post. Confirm the last part for me? |
Forum: Java 23 Days Ago |
| Replies: 9 Views: 246 A binary search should eliminate half of the items each time a search is done. You can think of it similar to a dictionary. The way a binary search program would look up a word in the dictionary is... |
Forum: Java 23 Days Ago |
| Replies: 8 Views: 237 Cool. Mark the thread as solved please. |
Forum: Java 23 Days Ago |
| Replies: 9 Views: 246 I think bucket sort or radix sort is supposed to be the best for that, but I don't remember the argument there, so look into it those topics. |
Forum: Java 23 Days Ago |
| Replies: 1 Views: 173 The last part is definitely wrong. digit % 10, if digit = 245, will be 5. But digit never gets modified there, so your program will run forever. What you should be doing is using a combination of %... |
Forum: Java 23 Days Ago |
| Replies: 8 Views: 237 Did you add the helpMenu to your JPanel? You didn't provide enough code to see what's going on. The method you posted looks fine but I'm not sure if you ever added the helpMenu (that was returned) to... |
Forum: Java 23 Days Ago |
| Replies: 7 Views: 183 Again, that depends on what you mean by 'closing an account'. Typically you'd close an account by removing all the money from it, i.e. withdrawing all money from your bank account, then just deleting... |
Forum: Java 23 Days Ago |
| Replies: 8 Views: 237 if e.isSelected makes no sense because you already know which item is selected, and you already know that it's selected because otherwise the actionPerformed method wouldn't have been called. And if... |
Forum: Java 23 Days Ago |
| Replies: 7 Views: 183 What is a consolidated account? Just an account under both names? What do you have to do to 'make an account consolidated'? |
Forum: Java 23 Days Ago |
| Replies: 8 Views: 237 What is subpanel? Up till line 9 your code seems ok to me, after that I have no idea what you are trying to do. |