Class 1, Part 2 |
Intro to Java 30-IT-396 |
|
Exercise
-
I realize we have not yet covered Swing, but we're all pretty resourceful.
Let's just try this out with the GUI editor. Besides, this will be
a good intro to Swing.
-
Replicate what I have on slide 6805a.html .
-
First, open Forte'. Then choose New-JFrame.
-
When your JFrame is open in the GUI editor, click on the button on the
Swing menu at the top for a JLabel. Add that and enter some descriptive
text.
-
Next, click on the button for a JTextField. Add that.
-
Then, click on the button for a JButton. Add it.
-
Finally, click on the button for a JLabel and add that.
-
Now, right click on the JButton and follow the menu structure in slide
6805a.html to add an ActionListener.
-
When Forte'/NetBeans gives you the code for the ActionListener, enter the
code you see in 6805a.html . But you
may have to change the names of the objects to fit the names you gave them,
or the names they have by default.
-
Of course, see me if you need assistance.
Created by: Brandan
Jones January 4, 2002