package util; import java.awt.*; import java.awt.event.*; /** * Simple toplevel that deals with one component and sizing. */ public class SimpleFrame extends Frame { public SimpleFrame (String title) { super(title); addWindowListener( new WindowAdapter() { public void windowClosing(WindowEvent e) { SimpleFrame.this.dispose(); System.exit(0); } }); } public SimpleFrame () { this("Default"); } public Component add (Component child) { add("Center", child); pack(); return child; } }