Fill in the GUI Blanks
Here is the program (yet again!) but this time with some blanks for you to
fill in.
If you get stuck, first look back at the picture,
then look at the hint.
import java.awt.*;
import java.awt.________;
class myFrame extends Frame
{
public void paint ( Graphics g )
{
g._____________("Click the close button", 10, 50 );
}
}
class WindowQuitter extends ______________
{
public void windowClosing( WindowEvent e )
{
____________( 0 ); // what to do for this event--exit the program
}
}
public class GUItester
{
public static void main ( String[] args )
{
myFrame frm = new myFrame(); // construct a myFrame object
WindowQuitter wquit = new WindowQuitter(); // construct a listener for the frame
frm.addWindowListener( wquit ); // register the listener with the frame
frm._______________( 150, 100 );
frm._______________( true );
}
}
|
|