// MyWindowTester.java // Tests MyWindow class // Practice with anonymous inner classes, JFrame, windows, WindowAdapter import java.awt.event.*; import java.awt.*; import javax.swing.*; public class MyWindowTester { public static void main( String args[ ] ) { JLabel bogusName = new JLabel( "Emily Elizabeth" ); JTextField bogusBox = new JTextField( 20 ); MyWindow w = new MyWindow( ); w.addALabel( bogusName ); w.addAField( bogusBox ); w.setSize( 300, 150 ); w.show( ); w.addWindowListener( new WindowAdapter( ) { // anonymous inner class public void windowClosing( WindowEvent e ) { System.exit( 0 ); } }); } }