import javax.swing.*; import java.awt.*; public class LayoutTest extends JFrame { public LayoutTest () { JPanel northPanel = new JPanel(); FlowLayout fl = new FlowLayout(); fl.setAlignment(FlowLayout.LEFT); northPanel.setLayout(fl); JButton b11 = new JButton ("Norden 1"); JButton b12 = new JButton ("Norden 2"); JButton b2 = new JButton ("South"); JButton b3 = new JButton ("Center"); JButton b4 = new JButton ("West"); JButton b5 = new JButton ("East"); northPanel.add(b11); northPanel.add(b12); Container c = getContentPane(); BorderLayout bl = new BorderLayout(); c.setLayout(bl); c.add(northPanel, BorderLayout.NORTH); c.add(b2, BorderLayout.SOUTH); c.add(b3, BorderLayout.CENTER); c.add(b4, BorderLayout.WEST); c.add(b5, BorderLayout.EAST); } public static void main (String[] args) { LayoutTest lt = new LayoutTest(); lt.setSize(300,300); lt.setVisible(true); } }