OK, now its time to get serious: you are going to declare and add two TextFields, declare and a add another button, and declare two integer variables. In the next poisting, I'll show you how to use these tools to do stuff. Here's what you do first:
A) right below this line of code:
Button exit;
add this block of code:
Button passItOn;//declare another button
int wide, tall; //declare two variables
TextField across, up; //declare two TextFields
B) in your constructor, right below the three lines where added the exit button to your frame, you are going to add the three lines to add the "PassItOn" button
C) just below that, add the two lines for each Textfield (they wont need an actionListener)
D) just below that, set both int variables to 0 by typing in this:
wide=0;
tall=0;
E) add an "else if" to your actionPerformed right below the first if. This else if should make the variables wide and tall print to the black screen. See if you can finagle that on your own first.
Cheers,
Uncle Paulie
Tuesday, February 10, 2009
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment