Forum: Java 23 Hours Ago |
| Replies: 14 Views: 258 You had better get started then, saturday is tomorrow! James, if you were to charge $50/hour you'd only get about 3 bucks for that lol |
Forum: Java 3 Days Ago |
| Replies: 2 Views: 142 Yes, I echo the above post, remove the double quotes - you are using String literals instead of a numeric values. |
Forum: Java 3 Days Ago |
| Replies: 11 Views: 286 Break the problem down into smaller, easier to manage steps.
- Get user input
- Calculate the sum of the number(s) entered
- Print result
Show us that you have put some effort in by showing us... |
Forum: Java Oct 28th, 2009 |
| Replies: 10 Views: 284 Help you to cheat......NO. My theory here is that your tutor gave you the .class files to see how a program works, and you are then meant to write the code yourself. You will not learn java by... |
Forum: Java Oct 19th, 2009 |
| Replies: 7 Views: 366 here (http://java.sun.com/docs/books/tutorial/)
Please do not hijack threads, start a new one! |
Forum: Java Oct 19th, 2009 |
| Replies: 7 Views: 366 Nobody ever learnt to program in Java by using drag 'n' drop. |
Forum: Java Oct 18th, 2009 |
| Replies: 5 Views: 1,180 They all do quuba lol i.e the ones with >= 3 arg's to printf |
Forum: Java Oct 18th, 2009 |
| Replies: 5 Views: 1,180 Hi quuba, thanks for the reply. Having tried that, I still get the same compilation error at the command line, although it works fine in NetBeans. Seems very odd! |
Forum: Java Oct 18th, 2009 |
| Replies: 7 Views: 366 Take a look at Line 23 where you declare the int variable vacation. This variable is declared within the body of a conditional statement, which means its lifespan is confined to that conditional... |
Forum: Java Oct 16th, 2009 |
| Replies: 5 Views: 1,180 Hi all, I hope you are well. I am trying to compile a java file using terminal in Ubuntu, but I am getting the following error message:
As you can see, I am passing three String arguments to... |
Forum: Java Oct 16th, 2009 |
| Replies: 11 Views: 389 here (http://java.sun.com/docs/books/tutorial/uiswing/events/actionlistener.html) |
Forum: Java Oct 7th, 2009 |
| Replies: 4 Views: 339 nomemory means compile the classes then run TestCircle. You cannot run Circle directly as it has no main method. main is the entry point for you program. As nomemory said, don't skip the basics.... |
Forum: Java Oct 7th, 2009 |
| Replies: 12 Views: 338 saucer is an object of TYPE Disk. Disk is a class. Remember, in java, Classes are blueprints for objects. So, yes you will need the Disk class. Place the code in the same package as class TestDisk... |
Forum: Java Oct 3rd, 2009 |
| Replies: 4 Views: 312 Take a look at line 91:
mbar.add(mnuHelp);
mnuHelp has NOT been initialized, so you will get a Null Pointer Exception. To rectify this, initialize mnuHelp where you initialize the other two... |
Forum: Java Oct 3rd, 2009 |
| Replies: 4 Views: 312 What is the exact error message? Is it a compilation error? Or a runtime exception you are encountering? |
Forum: Java Oct 3rd, 2009 |
| Replies: 11 Views: 408 You could use the escape sequence "\n" after you print out the 4th element in the array? Or use just System.out.println(); after the 4th element has been printed. |
Forum: Java Oct 3rd, 2009 |
| Replies: 1 Views: 255 You can create an ImageIcon and display it as the content of a JLabel. Then put the JLabel in the content pane of your JFrame. Look here:
Tutorial... |
Forum: Java Oct 2nd, 2009 |
| Replies: 4 Views: 1,423 That's great, thanks for your input on this snippet. The clearer it is to others, the better! |
Forum: Java Oct 1st, 2009 |
| Replies: 4 Views: 1,423 Thanks for that input masijade, I have found that the call to super() is often omitted in these circumstances, and that explicitly calling super() is redundant, because it is called implicitly. It... |
Forum: Java Oct 1st, 2009 |
| Replies: 4 Views: 1,423 I just wanted to demonstrate a quick point regarding Constructors & inheritance.
Look at these two classes and think about what you might expect to see after the main method has run.
Notice that... |
Forum: Java Sep 30th, 2009 |
| Replies: 3 Views: 273 You have not specified a constructor for class Complex that accepts two doubles as parameters. There are two things you could do:
1- Rename void "setValue" to "public Complex" and give the Complex... |
Forum: Java Sep 30th, 2009 |
| Replies: 14 Views: 1,191 why not use a JSpinner?
EDIT> misread the question, just use a JFormattedTextField as said by the other two. |
Forum: Java Sep 30th, 2009 |
| Replies: 1 Views: 145 Take a look here:
hyperlink Jbutton (http://stackoverflow.com/questions/527719/how-to-add-hyperlink-in-jlabel)
An answer on that thread states that it might be better to add the Hyperlink to a... |
Forum: Java Sep 29th, 2009 |
| Replies: 1 Views: 148 I would suggest you read this tutorial on event handling:
sun tutorial
(http://java.sun.com/docs/books/tutorial/uiswing/events/intro.html)
This has the information you need. |
Forum: Java Sep 29th, 2009 |
| Replies: 4 Views: 225 You are welcome, it's often the obvious things that we all miss! Please mark the thread as solved! |
Forum: Java Sep 29th, 2009 |
| Replies: 4 Views: 225 On line 15, you are parsing the user input to an integer, and integers do not function with decimals. Parse the input string to a double:
double mileage = Double.parseDouble(mileageInput); |
Forum: Java Sep 28th, 2009 |
| Replies: 4 Views: 436 I believe its a Dimension variable, so :
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
I hope that helps. |
Forum: Java Sep 28th, 2009 |
| Replies: 4 Views: 436 Take a look here:
http://www.daniweb.com/forums/thread21301.html |
Forum: Java Sep 28th, 2009 |
| Replies: 2 Views: 200 You can download NetBeans :
here (http://download.netbeans.org/netbeans/6.0/final/)
:) |
Forum: Java Sep 28th, 2009 |
| Replies: 12 Views: 649 Have you added the panel to the JFrame? Is the JFrame set to "setVisible(true)"? Can you post the rest of the code please? |
Forum: Java Sep 28th, 2009 |
| Replies: 3 Views: 683 look at line 37, you are adding a panel to itself. This will cause an Illegal Argument Exception. Comment out line 37 and think about what it is you are trying to do. It will run (maybe not quite as... |
Forum: Java Sep 28th, 2009 |
| Replies: 3 Views: 683 theo19, for a start you have confused the names on lines 22 to 24, you have written:
JPanel row2pane1 = new JPanel();
JPanel row3pane1 = new JPanel();
JPanel row4pane1 = new JPanel();
... |
Forum: Java Sep 27th, 2009 |
| Replies: 2 Views: 346 I wrote a paint application quite recently in Java actually, if you are willing to show effort and make a start - then you could come back with specific questions. I, and my peers will no doubt be... |
Forum: Java Sep 27th, 2009 |
| Replies: 2 Views: 323 As quuba said, you have declared panelCenter2 but you are still adding the JButtons jn4, jn5 and jn6 to panelCentre1 - which is positioned using BorderLayout.CENTER. Hence why your last three buttons... |
Forum: Java Sep 24th, 2009 |
| Replies: 4 Views: 260 Hi msalahu, you could try compiling the source code from the command line and add the "deprecation" switch, which will show you a description of members/classes that have been used and have been... |
Forum: Java Sep 22nd, 2009 |
| Replies: 6 Views: 385 Ok the problem there is that you have not initialized the variable MenuBar before you call the method buildMenus() on it, therefore you get a null pointer exception. You need to initialize MenuBar... |
Forum: Java Sep 22nd, 2009 |
| Replies: 6 Views: 385 You need to add:
notepadFrame.add(MenuBar);
before you set notepadFrame.setVisible(true);. This adds the MenuBar to the Frame. |
Forum: Java Sep 22nd, 2009 |
| Replies: 6 Views: 385 Peter_budo you beat me to it! :) Kahaj, what you could do is :
declare and initialize MenuBar as a class field, instead of a local variable in method buildMenus() :
JMenuBar MenuBar;
you can... |
Forum: Java Sep 22nd, 2009 |
| Replies: 6 Views: 236 Please use code tags people, the code is very ugly without them, and difficult to read. redrocket0274 - what is your program meant to do ? At the moment it doesn't look like its doing much of... |
Forum: Java Sep 22nd, 2009 |
| Replies: 4 Views: 413 lol thanks for that Jasimp, silly me! :) |