import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Fenster3 implements ActionListener { public static void main(String[] aaa) { JFrame f = new JFrame("Mein 3. Fenster"); // Toolbar bauen JPanel toolbar = new JPanel(); toolbar.setLayout(new FlowLayout(FlowLayout.LEFT)); toolbar.add(new JButton("Load")); toolbar.add(new JButton("Save")); JButton ende = new JButton("Exit"); toolbar.add(ende); ende.addActionListener(new Fenster3()); // StatusZeile bauen JLabel status = new JLabel ("Alles in bester Ordnung."); Container c = f.getContentPane(); c.setLayout (new BorderLayout()); c.add(toolbar, BorderLayout.NORTH); c.add(status, BorderLayout.SOUTH); JTextArea text = new JTextArea("Es war einmal..."); JScrollPane textPane = new JScrollPane(text); c.add(textPane, BorderLayout.CENTER); f.pack(); f.setVisible(true); } public void actionPerformed(ActionEvent e) { System.out.println("Beende mich auf Benutzer-Wunsch"); System.exit(0); } }