/*
 * 1.1 version.
 */

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

public class CustomWindow extends Frame {
    boolean inAnApplet = true;
     
    public CustomWindow() {
        setLayout(new DiagonalLayout());
        setFont(new Font("SansSerif", Font.PLAIN, 14));
   
        add(new Button("Button 1"));
        add(new Button("Button 2"));
        add(new Button("Button 3"));
        add(new Button("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[]) {
        CustomWindow window = new CustomWindow();
        window.inAnApplet = false;

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