Changing the Current Menu Bar

You can add multiple menu bars to a form, but only one can be the current menu bar. The current menu bar is displayed in the Form Designer and initially displayed when the form is run. You can write code to switch the current menu bar during runtime.

In the Form Editor, one menu bar can be active in the main form hierarchy and visible in the Form Designer pane. You can have other menu bars under the Other Components node of the Component Inspector.

To change the current menu bar in the Form Designer:

  1. Use Cut and Paste operations to move the current menu bar from the main form to the Other Components node:
    1. Select the current menu bar from the Form Designer or Component Inspector.
    2. Right-click to display the contextual menu and choose Cut.
    3. Select the Other Components node in the Component Inspector, right-click, and choose Paste from the contextual menu.
  2. Use Cut (or Copy) and Paste operations to move the new menu bar from the Other Components node to the Form Designer.
Tip A menu bar can be pasted only to JFrame, JDialog, or JApplet containers.
See also
Creating a Menu Bar
Adding a Menu to a Menu Bar
Creating a Contextual Menu
Adding a Menu Item
Adding an Event Handler to a Menu Item

Legal Notices