<<< GridLayout and Radio Buttons | Index | Menu Events >>> |
To create a menu,
Create a menu bar
Add top-level menus
Add menu items to each of the top-level menus.
JMenu mHelp; JMenuItem mHelpAbout; mBar = new JMenuBar(); // menu bar this.setJMenuBar(mBar); // add to JFrame mHelp = new JMenu("Help"); // top-level menu mBar.add(mHelp); // add to menu bar mHelpAbout = new JMenuItem("About"); mHelp.add(mHelpAbout); // sub-menu
<<< GridLayout and Radio Buttons | Index | Menu Events >>> |