Practice pieces
GUI
This practice piece is just GUI construction, but gives you a chance to play with Frame's BorderLayout.
Hints:
You just need one, main, class to do this job.
The algorithm is:
// Make a class that extends
Frame
and implements ActionListener
.
// Give it a Button instance variable, with an appropriate label set using its constructor.
// Set up the Frame so it is the right size and is setVisble(true)
.
// Prior to setVisble, add the button, using add(buttonVariable, BorderLayout.SOUTH);
.
// Prior to setVisble, register this
as the button's actionListener.
// Code in the required actionPerformed()
method, and in it change the button's label.
If you need more help, here's the answers (or one option, anyhow), and some additional tasks.