FileDocCategorySizeDatePackage
Gridbag.javaAPI DocExample1108Mon Feb 02 22:50:30 GMT 1998None

Gridbag

public class Gridbag extends Applet

Fields Summary
Constructors Summary
Methods Summary
public voidinit()

    GridBagLayout gb = new GridBagLayout();
    GridBagConstraints gbc = new GridBagConstraints();
    Button b;
    setLayout(gb);
    gbc.gridwidth  = 1;
    gbc.gridheight = 1;
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.BOTH;
//    gbc.anchor = GridBagConstraints.NORTHWEST;
    b = new Button("First");
    add(b, gbc);
    b = new Button("Second");
    gbc.gridx = 1;
    gbc.gridwidth = 2;
    add(b, gbc);
    b = new Button("Third");
    gbc.gridx = 3;
    gbc.gridwidth = 1;
    add(b, gbc);
    b = new Button("Fourth");
    gbc.gridx = 0;
    gbc.gridy++;
    gbc.gridwidth = 4;
    add(b, gbc);
    b = new Button("Fifth");
    gbc.gridy++;
    gbc.gridwidth = 1;
    add(b, gbc);
    b = new Button("Sixth");
    gbc.gridx = 1;
    gbc.gridwidth = 3;
    gbc.gridheight = 2;
    add(b, gbc);
    b = new Button("Seventh");
    gbc.gridx = 0;
    gbc.gridy++;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    add(b, gbc);