
/*

	Display 12.1 
 */
import javax.swing.*;

public class FirstSwingDemo 
{

	public static final int WIDTH  = 300;
	public static final int HEIGHT = 200;

	public static void main( String[] args ) {


		JFrame myWindow = new JFrame( "First Swing Demo" );

		//where is setSize inherited?
		myWindow.setSize( WIDTH, HEIGHT );

		JLabel  myLabel = new JLabel( "Please don't click that button!");
		//Add Label to middle of content pane 
		myWindow.getContentPane().add(myLabel);

		WindowDestroyer myListener = new WindowDestroyer( );
		myWindow.addWindowListener( myListener );
		
		myWindow.setVisible( true );
		}
}

