Computer Science Canada Get input from user... |
Author: | Neo [ Thu Nov 04, 2004 8:17 pm ] | ||||
Post subject: | Get input from user... | ||||
This is a bit from my program:
What I want to do is get the user to input a value for x which will determine where the tree goes. This is the code to do so:
Where do I put this, because wherever I put it in my program it doesnt work. Ive tried to put it at the beginning of the program after the " public void init()" line and it compiles correctly but it does not ask the user to put in a number. Where do I need to put this line to make it work correctly? |
Author: | McKenzie [ Thu Nov 04, 2004 9:02 pm ] |
Post subject: | |
your x is going to have to a field of the class (instead of local to paint). Get its value in the init Method. |