A good answer might be:

The blanks are filled in, below.

Blanks filled.

import java.awt.*; 
import java.awt.event.*;
class myFrame extends Frame
{
  public void paint ( Graphics g )
  {
    g.drawString("Click the close button", 10, 50 );  
  }
}

class WindowQuitter extends WindowAdapter
{
  public void windowClosing( WindowEvent e )
  {
    System.exit( 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.setSize( 150, 100 );     
    frm.setVisible( true );      
  }
}

QUESTION 12:

(Thought question: ) Could the main() method be a static method of the myFrame class?

Click Here after you have answered the question