/************************************************************* * file: EmptyFrame.java * * Source: adapted from Core Java, vol.1, by Horstmann & Cornell * * Synopsis: * This is the simplest standalone example of Java GUI. * But this program does not even know how to terminate properly. * Clicking the window close button only makes the window * invisible, but not kill it (you do not get back to the * shell prompt). To kill this program, you will need * to type "CNTL-C". * * Course: Visualization, Spring 2003 * Chee Yap (yap@cs.nyu.edu) *************************************************************/ import javax.swing.*; class EmptyFrame extends JFrame { public EmptyFrame() { setTitle("My Empty Frame"); setSize(300,200); // default size is 0,0 setLocation(10,200); // default is 0,0 (top left corner) } public static void main(String[] args) { JFrame f = new EmptyFrame(); f.show(); } }