import javax.swing.*; import java.awt.*; import java.awt.event.*; public class TestFrame extends JFrame { public TestFrame (String title) { super (title); JButton button = new JButton("Klick mich!"); Container c = getContentPane(); FlowLayout fl = new FlowLayout(); fl.setAlignment(FlowLayout.LEFT); System.out.println(FlowLayout.LEFT); c.setLayout(fl); c.add(button); ActionHandler al = new ActionHandler(); button.addActionListener (al); JButton b2 = new JButton("Der Zweite"); JButton b3 = new JButton("Der Dritte"); c.add(b2); c.add(b3); } public static void main (String args[]) { TestFrame frame = new TestFrame("Hallo"); frame.setSize(400,300); frame.setVisible(true); frame.setDefaultCloseOperation(DISPOSE_ON_CLOSE); } }