FileDocCategorySizeDatePackage
FrameClose1.javaAPI DocExample400Thu Oct 24 20:14:22 BST 2002None

FrameClose1.java

// FrameClose1.java
// A demonstration of the SDK 1.3 EXIT_ON_CLOSE behavior for JFrames.
//
import javax.swing.JFrame;

public class FrameClose1 {
  public static void main(String[] args) {
    JFrame mainFrame = new JFrame();

    // Exit app when frame is closed.
    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    mainFrame.setSize(320, 240);
    mainFrame.setVisible(true);
  }
}