889 Posted Topics
Re: I haven't used JFree_Graph before, but that stack trace has given you a pretty detailed description of the encountered problem. I'm guessing that your problem line of code is: [code=java] series.add(new Millisecond(), lastValue); [/code] Try changing it to: [code=java] series.addOrUpdate(new Millisecond(), lastValue); [/code] and see what happens. | |
Re: Ok, so in your actionPerformed method, you put whatever code you need to do what you want when the button is pressed. Then you add the action listener to the button by writing the following: [code=java] myButton= new JButton ("Submit Grades");//inserting button myButton.setBounds( 16, 45, 208, 218 ); myButton.addActionListener( new … | |
Re: You want to say "while the guess is not correct and counter is <= 3, do something" right? You need to change your line that reads: [code=java] while( ! function1.equals( selection )) [/code] to: [code=java] while( ! function1.equals( selection ) && counter <= 3 ) [/code] The [B]&&[/B] means "and". … | |
Re: You can return your delimiters from the StringTokenizer by adding a third parameter when you create the tokenizer object. [code=java] StringTokenizer st = new StringTokenizer( input, delims, true ); [/code] Now your nextToken calls will return the delimiters as tokens as well. This will require changing how many calls you … | |
Re: We've just equalled our record number of days in a row above the old 100 degrees F and the forecast says it will continue for at least the next seven days. It's supposed to be autumn here... | |
Re: You write it like this: [code=c++] int main() { int x, y; cin >> x; cin >> y; if (x==0 && y==0) // the && means and, use || for or { cout << "x/y = 0"; } else { cout << "neither is 0"; } return 0; } [/code] | |
Re: Your functions absolute(), fibonacci() etc are in a class called Main, but you have called these methods for a variable of type myFunctions. I'm not sure if that is what is causing your exact error from the compiler, but this can't be good... | |
Re: Hi chapelhoffer and welcome to DaniWeb, This question should probably go in the C++ forum, but now that we are here I will try to help you out. Let's take for example your member function called debit. Inside your main function, if you want to debit a certain bank account … | |
Re: The lines that read: [code=java] return result; [/code] should be removed from your main method. The main method should just use that result variable rather than attempting to return it. | |
Re: You are probably better off using a local smtp server if you have access to one... | |
Re: Hi ekirkco, Can I just ask why you use a signed shift in your write methods? I'm just wondering because I saw this in another example on another forum but it wasn't explained and I had trouble when sending data to another computer. I ended up using an unsigned shift … | |
Re: I'm not 100% sure, but I think this issue could have to do with threads. I think what is happening is the cmd.exe is being run in the main thread and there is no other thread to run the rest of class A until you quit the cmd.exe. If I … | |
Re: System.in is the standard input stream that java supplies to get input from the console. I usually use code that looks like this: [code=java] BufferedReader input = new BufferedReader( new InputStreamReader( System.in ) ); [/code] Then use the readLine() method in the BufferedReader class to read each line of input. … | |
Re: Ok, so what have you done so far? Or where exactly are you having problems? We can only point you in the right direction - we can't do it for you. | |
Hi all, I am fairly new to using Eclipse (or any IDE for that matter) and I am having trouble getting the TPTP Profiler plugin working. I'm hoping that someone out there might have seen this behaviour before and has the fix for it... :) I am running Eclipse 3.3.1.1 … | |
Re: The print function is O(n), so you were right the first time. Although n changes each call to print, it is still O(n) since each time print is called it takes roughly n steps to compute. I'm not completely sure, but I think the second recursive call will also be … | |
Re: Hi ladyjade555 and welcome to DaniWeb :) Ok there are a couple of issues with our code that I can see with a quick read-through. Line 40 is [code=java] import java.lang.Math; [/code] You don't need to explicitly import any classes or packages that start with java.lang - these are the … | |
Re: [QUOTE=xanine;508158] if (combi.equals(combi.toLowerCase()) || combi.equals(combi.toUpperCase()))[/QUOTE] This statement in plain english reads: if thisString equals thisStringConvertedToLowerCase or thisStringConvertedToUpperCase then... This will ONLY be true if the entire string is written in lower or upper case. If there is any other combination of upper and lower case letters in your string it … | |
Re: Better yet, maybe just give us a [I]brief[/I] overview of what your program does and we will try to guide you. If we need to see your code, we'll let you know :) | |
Re: -- Arnold Schwarzenegger "I'll be back" "He had to split" "I had to let him go" "Hasta la vista, baby" "Let off some steam, Bennet" "It's not a tumor" "I like you so I'll kill you last" "Consider this a divorce" "I eat green berets for breakfast... and right now … | |
Hi all, I was wondering if anyone had tried to use the Quicktime for Java platform to stream video in either MPEG-4 or MJPG formats? Can the platform be used in linux if it uses the third-party Quicktime for Linux? Or is there another platform that might be suitable for … | |
Re: The java.awt.PrintJob class is what you need here. You create the PrintJob object and set the header, body and footer of what you want printed then tell it to print. For more information, check out the [URL="http://java.sun.com/javase/6/docs/api/"]Java API[/URL] for the PrintJob class. | |
Re: Hi dharajsmith and welcome to Daniweb :) Your System.out.printf lines are incorrect syntax in Java. As an aside, please put code in code tags as it makes it easier to read. | |
Re: Hi there chaky1, I would suggest downloading the latest drivers for your graphics card, but it might pay to post your question in one of the IT forums. This forum is specifically for game development and we don't necessarily know much about what might be happening with a particular game … ![]() | |
Re: Australia and proud of it! Happy New Year everyone! | |
Re: Hi there fm_hyudin and welcome to Daniweb, We are not allowed to help you until you show us that you have made an effort to answer the question yourself. What have you done so far? | |
Re: I'm getting hollystyles' and AD's problem but only in the Java forum and only sometimes. I'm browsing in firefox on xp also. | |
Re: Hi bramu and welcome to Daniweb. What DVD Burner do you have? What blank DVD's are you using? What software are you using? What errors do you get when you try to burn? | |
Re: That error normally occurs when you try to run the java class file without having first compiled it. The correct (two) commands are: javac E:\Chap1\source.java java E:\Chap1\source As far as I know it shouldn't matter where your files are located if you provide the full path. | |
Re: Yes I think your code will give you exactly one instance of your class. | |
Re: Rather than implementing the ActionListener in your class, it is probably better to add an ActionListener to your menu item. You can do this by [code=java] // Exit menu item exitItem = new JMenuItem("Exit"); exitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK)); exitItem.addActionListener(new ActionListener() { public void actionEvent(Event e) { System.exit(0); } }); fileMenu.add(exitItem); [/code] However, … | |
Re: Hi ronghel, If I gave you a list of numbers and asked you which one was the biggest, how would you do that? (Not in code, just in life...) For your second one, if I gave you a list of numbers and asked you if there were any duplicates in … | |
Re: Hi there Joe and welcome to Daniweb, IMHO there is no real right or wrong answer here. But speaking from personal experience I learned Java first then moved on to C and C++. I found this way of learning the three languages effective [I]for me[/I] and there are a few … | |
Re: Just wondering, how does one's rep power increase? Is it to do with your own rep? Or the number of posts you have made? Or something else entirely? | |
Re: Hey there kafil03, Sorry but that's against the DaniWeb rules. We can only show you the door; it is up to you to step through it. That is, try doing some yourself and if you come across some specific problems, post in the appropriate forum and I'm sure someone will … | |
Re: Hey there babyfrostie, Are you having trouble reading the file, sorting the file or outputting the file? Because they are the three tasks you need to do... | |
Re: your slowMoveVertical method seems like an infinite method to me. When does it stop? | |
Re: Hi freddiecool and welcome to DaniWeb, Not sure if this is your problem, but your variables should be initialised as private. ie: [code=java] private pryDialog pd = new pryDialog(); private int option = 0; [/code] | |
Re: so what have you done so far? | |
Re: if guessI is a String and word is a String then you can use the equals or equalsIgnoreCase methods to compare them. [code=java] if (guessI.equals(word)) { // true if guessI and word are exactly the same } if (guessI.equalsIgnoreCase(word)) { // true if they are the same regardless of case … | |
Re: Hi mir12 and welcome to DaniWeb, We have pretty strict rules here about doing other people's homework for them (we won't!!) So you need to show us what you've done, and ask some [I]specific[/I] questions about your problem. | |
Re: Change line 102 to [code=java] PhoneInterface1 pi1 = new PhoneInterface1(); [/code] | |
Re: Hi there gpsmike and welcome to Daniweb, Your question sounds like a javascript question as opposed to pure Java and there is another forum for JS under Web Development. Try posting there and maybe someone with more knowledge of JS might be able to help you. Good luck :) darkagn | |
Re: > start quote: if(number > 1){ System.out.print("You will become rich."); System.out.print("You will meet your evil twin in 2 days."); System.out.print("Look out for the number 8. It means danger."); System.out.print("You will lose your memory after today!."); } > end quote. This statement reads "for any number entered that is greater than … | |
Re: Actually the FlowLayout will wrap around after you "fill" your first row. But I think you might find it easier to use something else. Might I suggest a BorderLayout, with a BoxLayout in the BorderLayout's CENTER panel to house the username and password fields. | |
Re: Why can't you use a loop to do this? It would be so much easier and it really shouldn't matter if you do. If it is that important not to use a loop, do you know the size of the array before the user inputs the numbers? | |
Re: It looks to me like it is a flag to tell whether something has been inputted or not. If it hasn't, isFixReg is set to true, and pressing a number (for example) starts a new String. Otherwise, isFixReg is false and entering a number will add to the existing text. … | |
Re: Hi Sebouh, I'm not 100% sure how to do what you want, but Java does have quite a few sql libraries in its API known as the JDBC. If you post your question in the Java forum, someone with more knowledge than I can claim might be able to help … | |
Re: Hi markn50 and welcome to DaniWeb. I hope you find the answers you seek... |
The End.