super("Swing application"); Container contentPane = getContentPane(); contentPane.add(new Panel(), BorderLayout.CENTER);
final JFrame f = new Ch06_04(); f.setBounds(100, 100, 300, 300); f.setVisible(true); f.setDefaultCloseOperation(DISPOSE_ON_CLOSE); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } });