/*
 * 1.1 version.
 */

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

public class GridWindow extends Frame {
    boolean inAnApplet = true;

    public GridWindow() {
        setLayout(new GridLayout(0,2));
        setFont(new Font("SansSerif", Font.PLAIN, 14));
   
        add(new Button("Button 1"));
        add(new Button("2"));
        add(new Button("Button 3"));
        add(new Button("Long-Named Button 4"));
        add(new Button("Button 5"));

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

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

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