FileDocCategorySizeDatePackage
NoneWindow.javaAPI DocExample1438Tue Dec 12 18:59:00 GMT 2000None

NoneWindow

public class NoneWindow extends JFrame

Fields Summary
boolean
inAnApplet
private boolean
laidOut
private JButton
b1
private JButton
b2
private JButton
b3
Constructors Summary
public NoneWindow()


      
        Container contentPane = getContentPane();
        contentPane.setLayout(null);

        b1 = new JButton("one");
        contentPane.add(b1);
        b2 = new JButton("two");
        contentPane.add(b2);
        b3 = new JButton("three");
        contentPane.add(b3);

        Insets insets = contentPane.getInsets();
        b1.setBounds(25 + insets.left, 5 + insets.top, 75, 20);
        b2.setBounds(55 + insets.left, 35 + insets.top, 75, 20);
        b3.setBounds(150 + insets.left, 15 + insets.top, 75, 30);

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

        NoneWindow window = new NoneWindow();
        Insets insets = window.getInsets();
        window.inAnApplet = false;

        window.setTitle("Absolute Positioning");
        window.setSize(250 + insets.left + insets.right,
                       90 + insets.top + insets.bottom);
        window.setVisible(true);