FileDocCategorySizeDatePackage
ApplicationFrame.javaAPI DocExample774Mon Apr 05 10:02:14 BST 1999None

ApplicationFrame

public class ApplicationFrame extends Frame

Fields Summary
Constructors Summary
public ApplicationFrame()

 this("ApplicationFrame v1.0"); 
public ApplicationFrame(String title)

    super(title);
    createUI();
  
Methods Summary
public voidcenter()

    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    Dimension frameSize = getSize();
    int x = (screenSize.width - frameSize.width) / 2;
    int y = (screenSize.height - frameSize.height) / 2;
    setLocation(x, y);
  
protected voidcreateUI()

    setSize(500, 400);
    center();

    addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        dispose();
        System.exit(0);
      }
    });