1,678 Posted Topics
Re: character[0] wasn't initialized . . that's all I can tell you from the information given. | |
Re: @ OP: You're using the Date class constructor incorrectly. It says to put the arguments in as year, month, day. Furthermore if you read the Javadoc for the Date class's [URL="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html#Date%28int,%20int,%20int%29"]constructor you are using[/URL] you will see that even if you reorder your parameters, it still won't work as expected. … | |
Re: David, I think this example might help. Note that you should still check out the link Ezzaral selected; I only implemented one of three methods that it suggested to implement. [CODE]public class Person { String ssn = ""; String firstName = ""; String lastName = ""; public Person(String ssn, String … | |
Re: Call the setDefaultCloseOperation method on your JFrame. | |
Re: There is a general set of rules for the site and numerous announcements telling you how to post in this forum. Any one of those things would have clarified that we don't write people's homework. I'll even link you to them. http://www.daniweb.com/forums/announcement9-2.html http://www.daniweb.com/forums/faq.php?faq=daniweb_policies | |
Re: [url]http://www.jdom.org/[/url] [url]http://www.javaworld.com/javaworld/jw-05-2000/jw-0518-jdom.html[/url] | |
Re: Try adding a leading "/" in the call to getResource() | |
Re: Jtodd, stultuske has already provided you with the correct information. . if you take a look at the [URL="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Random.html"]Javadoc for Random[/URL], you'll see that there is a method defined as "public int nextInt(int n)" that will be helpful in doing what he suggested. Again, the trick is to have that … | |
Re: I've never seen anybody do something like "return main()" before. Use a while loop instead if you are trying to get the effect of looping. | |
| |
Re: The ads don't bother me except for the large one at the top that constantly pops itself up when I'm trying to click on the forum name. | |
Re: Add one to the other using a for loop or a for-each loop. Use Collections.sort(linkedList) to sort it. | |
Re: [CODE]Collections.sort(yourArrayList);[/CODE] [url]http://java.sun.com/j2se/1.4.2/docs/api/java/util/Collections.html#sort%28java.util.List%29[/url] And mark your other thread solved, since you're apparently finished with it. | |
Re: If your teacher requires that you make your own get, remove, etc, then there is a good chance your teacher also requires that you use your own array - not ArrayList. That being said, if you really want to have your own get method, you could do [CODE] public Car … | |
Re: Should we assume that you followed the rules, asked a specific question, and showed effort towards solving the problem? Or would you like the working code, freshly baked, straight from [Salem, Ancient Dragon, WaltP, Narue]'s oven? In the latter case you're more likely to get my stale humor instead. :icon_rolleyes: | |
Re: Do you mean a [I]JFormattedTextField[/I]? And you'd do something like [CODE]Integer.parseInt(textField.getValue());[/CODE] Keep in mind that you should use a try catch in case of input error. Double has a similar method if you want to parse a double. | |
Re: [URL="http://www.javapractices.com/topic/TopicAction.do?Id=17"]Read this article[/URL]. If you have any questions after reading it, post them. | |
Re: Follow the rules and post a question and show effort. | |
Re: Code snippets are for working code examples, not for getting help. Normal threads with your code [I]in code tags[/I] are for help. | |
Re: private - only access it in methods of the same class. If you don't like this but want to keep it private, either use get and set methods or you're out of luck. | |
Re: 1. Explain exactly what you are stuck on. 2. Explain why you are stuck. This information might include what inputs make your program fail, what section of your program is failing (with line numbers), etc. | |
Re: You could start by getting a book from the library and reading about master theorem or by looking it up online. It isn't impossible. | |
Re: [QUOTE=handrews3583;1145584] If I put just one system.exit() at the end of the program, will this terminate each one as it is completed? [/QUOTE] You don't need to put System.exit() in your program at all. Just take it out completely. Your program runs in a top to bottom (sequential) fashion, so … | |
Re: [url]http://blogs.msdn.com/excel/archive/2008/04/10/understanding-floating-point-precision-aka-why-does-excel-give-me-seemingly-wrong-answers.aspx[/url] Probably a precision problem. There is no error, it is just a side effect of using binary digits to store certain values. | |
Re: I think that the way Dani has chosen to do the rep system is good. The fact that some members seem to have gotten the short end of the stick isn't the whole story: if Dani changes the rep system in certain ways, then the only thing that will change … | |
Re: The funniest thing about Ancient Dragon's post is that the google search's second result is this thread. :) | |
Re: A more feasible way to decide which array to store it in would simply be to use if statements to decide. So [CODE]if (myString.equals("arrayName")){ arrayName[someIndex] = someData; }[/CODE] Other than that, you could look at the Java Class called "Class" and use some of those methods. Take a look in … | |
| |
Re: You should only init your JTextFields [I]once[/I] in the entire program. Therefore, it doesn't make sense to call initJTextFields from within your showKey method. You should init the JTextFields when the GUI is first created, then you should .add() them to your JPanel. Here is an example to help you. … | |
Re: [URL="http://kenai.com/projects/jogl/pages/Home"]Java Bindings for Open GL[/URL] | |
Re: Because you linked us to an entire document instead of summarizing what you're trying to do and why you're having trouble. Anyway, I looked through it for you, all you should need to do once you're finished is send an email to your school email address. If it eventually gets … | |
Re: Since E extends GEObject, therefore anything which answers true to being an instanceof E will also be an instanceof GEObject. So why don't you just change that line to [CODE]if (o instanceof GEObject)[/CODE] Also, what are you actually trying to accomplish here (code like yours is seldom necessary - I'm … | |
Re: [CODE]for (side3 = 3; side3 <= 3; side3++) [/CODE] has no effect whatsoever other than setting side3 equal to 3. As far as looping, it does nothing. | |
Re: [URL="http://ww[U]w.gnu.org/s/libc/manual/html_node/Finding-Tokens-in-a-String.html"]Read about strtok[/URL] which tells you what function to use to separate a string into tokens. Then use [URL="http://www.opengroup.org/onlinepubs/007908799/xsh/atoi.html"]atoi[/URL] to try to parse the string as an int. | |
Re: Never used it, looks simple enough though [url]http://www.jasypt.org/[/url] | |
Re: It looks to me like you're using DataInputStream and FileInputStream properly. Where are you getting stuck? Is it doing anything from the setText line? | |
My book says that interrupt chaining is a "compromise between the overhead of a huge interrupt table and the inefficiency of dispatching to a single interrupt handler." I understand how the interrupt vector table works & why dispatching to a single interrupt handler is worse than choosing from an array. … | |
Re: You said System.out.println(s) which prints your Scanner Object. Shouldn't you be saying [CODE]System.out.println(test.toString());[/CODE] | |
Re: [QUOTE=beforetheyknew;1151384] Im also having a problem with when i create and put objects in the collection i use the key (above 502146) which is the registration of the object how can i set that to the registration within the collection? (when i print out the collection the registration is null). … | |
Re: You can also use scannerInput.nextLine() to grab an entire line of text. I don't understand what exactly you're trying to do though. If you give us some short sample inputs, and tell us what you want to happen after those inputs are read in, that would be helpful... | |
Re: How could the remainder of 2/3 be higher than 2? [url]http://www.icoachmath.com/Controls/Remainder.html[/url] | |
Re: And apparently other people like to up three year old threads on forums. Who would've thought? | |
Re: Use code tags. The button is right there on your reply box. It says 'code'. That way we will know what line you are talking about. | |
Re: If you go by most medals it was the U.S. If you go by most gold medals I think it was Canada. | |
Re: Hard to believe that you're only 16. You've accomplished quite a lot .. I look forward to continuing to see you around the site! :) | |
Re: The game ends because you closed the socket between the client/server pair and because you have no while loop or other loop structure to facilitate each player taking turns. And I don't see why you're asking whether each should be a client or a server. You can't run a client … | |
Re: All you did was post your project description and your code. [url]http://java.sun.com/docs/books/tutorial/essential/concurrency/procthread.html[/url] Read through this tutorial. Threads can cause problems and be challenging, but the basic principles are very usable. |
The End.