import javax.swing.*; public class TryFrame { public static void main(String[] argv) { TFrame f = new TFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.show(); } } class TFrame extends JFrame { public TFrame() { setSize(300,200); setTitle("This is a test"); } }