super("Swing Example"); Container contentPane = getContentPane(); p = new Panel(); contentPane.add(p);
final JFrame f = new SwingClass(); f.setBounds(100, 100, 280, 250); f.setVisible(true); f.setDefaultCloseOperation(DISPOSE_ON_CLOSE); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } });