/*
 * 1.1 version.
 */

import java.awt.*;
import java.awt.event.*;

public class BorderWindow extends Frame {
    boolean inAnApplet = true;
     
    public BorderWindow() {
        setLayout(new BorderLayout());
        setFont(new Font("SansSerif", Font.PLAIN, 14));
   
        add("North", new Button("North"));
        add("South", new Button("South"));
        add("East", new Button("East"));
        add("West", new Button("West"));
        add("Center", new Button("Center"));

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

    public static void main(String args[]) {
        BorderWindow window = new BorderWindow();
        window.inAnApplet = false;

        window.setTitle("BorderWindow Application");
        window.pack();
        window.setVisible(true);
    }
}
