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);