@@ -0,0 +1,1445 @@
+%0Apackage net.restlesscoder.sandbox;%0A%0Aimport java.awt.Button;%0Aimport java.awt.Frame;%0Aimport java.awt.Menu;%0Aimport java.awt.MenuBar;%0Aimport java.awt.MenuItem;%0Aimport java.awt.event.WindowAdapter;%0Aimport java.awt.event.WindowEvent;%0A%0Aimport javax.swing.JButton;%0Aimport javax.swing.JFrame;%0Aimport javax.swing.JMenu;%0Aimport javax.swing.JMenuBar;%0Aimport javax.swing.JMenuItem;%0Aimport javax.swing.WindowConstants;%0A%0Apublic class LotsOfMenuCommands %7B%0A%0A%09public static void main(final String... args) %7B%0A%09%09makeFrame();%0A%09%09makeJFrame();%0A%09%7D%0A%0A%09private static void makeJFrame() %7B%0A%09%09final JFrame f = new JFrame(%22Hello%22);%0A%09%09f.getContentPane().add(new JButton(%22Go%22));%0A%0A%09%09f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);%0A%0A%09%09final JMenuBar menubar = new JMenuBar();%0A%09%09f.setJMenuBar(menubar);%0A%09%09final JMenu file = new JMenu(%22File%22);%0A%09%09menubar.add(file);%0A%09%09for (int i = 0; i %3C 40; i++) %7B%0A%09%09%09file.add(new JMenuItem(%22Item #%22 + i));%0A%09%09%7D%0A%0A%09%09f.pack();%0A%09%09f.setVisible(true);%0A%09%7D%0A%0A%09private static void makeFrame() %7B%0A%09%09final Frame f = new Frame(%22Frame%22);%0A%09%09f.add(new Button(%22Go%22));%0A%0A%09%09f.addWindowListener(new WindowAdapter() %7B%0A%0A%09%09%09@Override%0A%09%09%09public void windowClosing(final WindowEvent e) %7B%0A%09%09%09%09f.dispose();%0A%09%09%09%7D%0A%09%09%7D);%0A%0A%09%09final MenuBar menubar = new MenuBar();%0A%09%09f.setMenuBar(menubar);%0A%09%09final Menu file = new Menu(%22File%22);%0A%09%09menubar.add(file);%0A%09%09for (int i = 0; i %3C 40; i++) %7B%0A%09%09%09file.add(new MenuItem(%22Item #%22 + i));%0A%09%09%7D%0A%0A%09%09f.pack();%0A%09%09f.setVisible(true);%0A%09%7D%0A%0A%7D%0A

Add a test of menus with many menu items