import java.awt.*;import java.awt.event.*;import javax.swing.*;public class MenueTest extends JApplet{ public void init() { JMenuBar mb = new JMenuBar(); JMenu fileMenu = new JMenu("Datei"); JMenu workMenu = new JMenu("Bearbeiten"); JMenuItem saveItem = new JMenuItem("Sichern"); JMenuItem printItem = new JMenuItem("Drucken..."); JMenuItem exitItem = new JMenuItem("Beenden"); JMenuItem optionItem = new JMenuItem("Optionen"); exitItem.addActionListener(new ExitListener()); fileMenu.add(saveItem); fileMenu.add(printItem); fileMenu.add(exitItem); mb.add(fileMenu); workMenu.add(optionItem); mb.add(workMenu); setJMenuBar(mb); }}class ExitListener implements ActionListener{ public void actionPerformed(ActionEvent e) { System.exit(0); }}