1,678 Posted Topics
![]() | Re: [url]http://72.5.124.55/j2se/1.4.2/docs/api/java/awt/Container.html#removeAll%28%29[/url] is that helpful? |
Re: [QUOTE=moutanna;1204498]The paycheck is a function not a class; and the functions could not be instanciated. that mean we should not write some think like: [CODE] paycheck p1 = new paycheck(nameInput, hourInput, wageInpu [/CODE] this is wrong. the word "new" is used to create an instance of class and MUST not … | |
Re: I see no errors... you're ignoring the 'open' variable inherited from the Cupboard class, though. | |
Re: Check out [URL="http://www.daniweb.com/forums/thread94021.html"]this daniweb thread[/URL] on scanf because if it is used improperly you can definitely have problems (such as overrunning the bounds of your char array) among other things. You also might want to see Dave Sinkula's snippet on [URL="http://www.daniweb.com/code/snippet216595.html"]reading an integer from the user[/URL] for a more thorough … | |
Re: You should set your initial lowest value to array[0], otherwise the lowest value variable will probably be initialized to 0, therefore, it will tell you the lowest value is 0 at the end. | |
Re: When do you want to check to make sure none of the fields are empty? When the 'add' button is clicked? You need to give more information. Regardless, you'd use an if statement. [CODE] if (buttonName.getText().equals("") || otherButton.getText().equals("")) //do something, your button's text was empty! [/CODE] | |
Re: It depends how the method is defined; some methods might be defined as "returns XXX under YYY conditions". If so, you could check the returned value for errors. Other than that, I don't know of any ways to do error checking, but Exceptions and return values are really all you … | |
Re: Don't use Eclipse's auto complete as a substitute for documentation and research. For example, did you read [URL="http://java.sun.com/docs/books/tutorial/uiswing/components/table.html"]this[/URL]? | |
Re: [url]http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Math.html[/url] round() | |
Re: I would personally make an Object to represent the data coming out of the database, assuming that the data is related. If you want to stuff anything into an array, you can use an ArrayList (or Vector if you need it to be synchronized). If you don't need it to … | |
Re: [QUOTE=zyaday;1202077] After creating the c object of Class2, is there anyways i can know which class instatiated it[/QUOTE] Yes, because the method that instantiates the 'c' Object is inside of Class1, therefore you already know that it was instantiated inside of Class1. Inside of method1(), the word "this" refers to … | |
Re: Call validate() on the JFrame after you reset the panel. You also might want to try creating the GUI like the java tutorials recommend i.e. what they do [URL="http://java.sun.com/docs/books/tutorial/uiswing/examples/components/ComboBoxDemoProject/src/components/ComboBoxDemo.java"]here[/URL]. (Although I don't think it is causing your problem, can't hurt to do it correctly) | |
Re: ^ Wtf ? I like to wear basketball shorts and t shirts. So comfy. | |
Re: [url]http://www.rgagnon.com/javadetails/java-0172.html[/url] Personally I'd just use Jquery though... (which obviously is written in javascript so you could use that like the above link). | |
Re: How do you plan to count the number of words? Do you mean, like, words that would appear in the dictionary? If that is the case then you are going to need to do a dictionary look up of each possible word from your input file. If you count a … | |
Re: Huh? Your explanation makes no sense to me... | |
Re: You could also create your own class that mimics the Scanner class's functionality; you'd basically include a constructor that takes a File Object, and you'd implement your own next() methods, etc... in those methods you could call the Scanner methods and also implement your own custom functionality (calling the AudioClip) | |
Re: I hope you don't expect anyone to do your homework for you. | |
Re: Agreed, [I]in this case[/I] your method should be declared as static. In general, however, making methods static is not a good solution. Methods should only be declared static when the method applies to the entire class rather than one specific instance. [url]http://java.sun.com/docs/books/tutorial/java/javaOO/classvars.html[/url] [url]http://leepoint.net/notes-java/flow/methods/50static-methods.html[/url] | |
Re: 1. Restart your computer, click F8 while it is restarting 2. Boot into "safe mode with Networking" 3. Try to double click a program to start it. If double clicking is now working, then you probably have a virus on your computer. Whether or not you have a virus, the … | |
Re: Implement the compareTo method of the Comparable interface. [url]http://www.javapractices.com/topic/TopicAction.do?Id=10[/url] [url]http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Comparable.html[/url] [url]http://leepoint.net/notes-java/data/expressions/22compareobjects.html[/url] | |
Re: Because you never called the reset method from within main. [CODE]public class ArrayReference { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub int[] array = {1, 2, 3, 4, 5}; setArray(array); for (Integer i: array) System.out.println(i); } public static void setArray(int[] array){ … | |
Re: There is no class called "Char". And you gave us the wrong error message, I'm pretty sure your compiler said "cannot find symbol - Char" | |
Re: I don't really know how to elaborate on the compiler's error message. It literally says exactly what the problem is: you're using a variable "START" which was never declared, which is illegal. Either declare it or get rid of it. It looks useless to me; so delete it. And where … | |
Re: No, there isn't. Just follow the directions, it told you what to do. And AFAIK you cannot add the same Swing component to multiple containers. It can only be added somewhere once. | |
| |
Re: I don't know what the 8 queens problem is. You'd be better off posting this in the Computer Science forum and giving a description of the problem if it is an algorithm question and not strictly a java programming question. | |
| |
Re: Does it really matter? A jar file is an executable and therefore, should be sufficient . . | |
Re: You called "this".repaint(). Try doing [CODE]if (event.getSource() == menuItem) menuItem.repaint();[/CODE] | |
Re: I took it for you and I answered honestly but your answers won't mean anything. You can't apply generalizations to a community unless you know who that community is composed of... | |
Re: The first question you asked doesn't even require google. The question isn't about any specific software [if it is, you didn't mention it], it just requires common sense. Most of the others only require a little research and mostly common sense also. For example if you don't know what a … | |
Re: Their seeds are, because they contain cyanide. It is a low amount, but eating a ton of apple seeds could harm you. | |
Re: Overall you need to cut out a lot of stuff. Only list your 3 most important jobs and give a brief description of what you did at those jobs and why it is relevant (what skills you learned). You were much too vague at certain points, for example, you mentioned … | |
Re: [QUOTE=jephthah;1196035]well, those can be excused becasue the poster thought they were posting a question correctly. the worst is these code snippet "programs" that with deprecated Turbo C libraries: they don't compile, they're so horribly written they're unreadable, and even if you take out the non-standard stuff, they're still broken and … ![]() | |
Re: [QUOTE=bfm;1197686]I'm sure this is not the right place to post this, but I thought I'd shout out to everyone to see if there's anyone can help. I have GOT to get off the internet more and I remember vaguely in the back of my mind from a million years ago … | |
Re: Hi Alex, as a software engineer you have a responsibility to learn how to use the internet. (Make your own thread :) ) | |
Re: Floor mats? Those are for walking on, not for windows... | |
Re: [QUOTE=Bobon;1196902] So you start the int z at 0 and run it through the length of array and then add the value in the array to the sum if it's less than 10. [/QUOTE] With the correction that you run it through the length of the array - 1, since … | |
Re: [url]http://java.sun.com/docs/books/tutorial/java/javaOO/enum.html[/url] Enum. See the planets example. | |
Re: John, [CODE]boolean whatever = first || second;[/CODE] The above expression will store "true" into the variable "whatever" under the condition that first is true [I]or[/I] second is true. If both "first" is false and "second" is false, it will store "false" into "whatever". So, to summarize, unless both "first" and … | |
Re: [QUOTE=nwalser;1194736]The Scrabble file should extend Echo, in the standard way we've indicated (it can also extend the LineReader class from Chapter 11 of the text). [/QUOTE] Java classes can only extend one other class, there is no multiple inheritance (some might argue about interfaces but meh). Anyway, what I would … | |
![]() | Re: I agree with closing old threads automatically. If someone has a related question a year later they can make a new thread. The downside (as Vernon mentioned) is losing some good points if someone has something useful to say. But that is a rarity compared to how many times spammers … ![]() |
Re: It passed in a String... T2('12').. scripting languages support operator overloading (I think that's the term) Had it passed in an int you would've been right | |
Re: Yeah, perhaps if you keep posting that question everywhere, we'll be more likely to help you with it. | |
Re: It isn't a good or a bad practice. It just depends on what your application is. Usually passing a List to a constructor would be fine... |
The End.