FileDocCategorySizeDatePackage
GridWindow.javaAPI DocExample1064Tue Dec 12 18:59:00 GMT 2000None

GridWindow

public class GridWindow extends JFrame

Fields Summary
boolean
inAnApplet
Constructors Summary
public GridWindow()


      
        Container contentPane = getContentPane();

        contentPane.setLayout(new GridLayout(0,2));
   
        contentPane.add(new JButton("Button 1"));
        contentPane.add(new JButton("2"));
        contentPane.add(new JButton("Button 3"));
        contentPane.add(new JButton("Long-Named Button 4"));
        contentPane.add(new JButton("Button 5"));

        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                if (inAnApplet) {
                    dispose();
                } else {
                    System.exit(0);
                }
            }
        });
    
Methods Summary
public static voidmain(java.lang.String[] args)

        GridWindow window = new GridWindow();
        window.inAnApplet = false;

        window.setTitle("GridLayout");
        window.pack();
        window.setVisible(true);