import javax.swing.*; public class ExitableJFrame extends JFrame { public ExitableJFrame() { } public ExitableJFrame(String title) { super(title); } public ExitableJFrame(GraphicsConfiguration gc) { super(gc); } public ExitableJFrame(String title, GraphicsConfiguration gc) super(title, gc); } protected void frameInit() { super.frameInit(); setDefaultCloseOperation(EXIT_ON_CLOSE); } }