<<< Making a Reusable ApplicationFrame Class | Index | JFrame Revisited >>> |
Our next sample demonstrates a simple program with two buttons in a frame.
Change Color button changes the color of the background.
Quit button causes the program to exit.
Notice few more changes that took place in FrameApplication class:
Although setFrameDimension( ) remains, it is no longer invoked by the constructor, presuming that the derived class will do that.
The
JFrame.setVisible(true);
is now a responsibility of FrameTwoButtons constructor.
<<< Making a Reusable ApplicationFrame Class | Index | JFrame Revisited >>> |