Creating a Menu Bar

  1. In the Component Palette, click a menu bar component:
    icon for JMenuBar - JMenuBar from the Swing components tab
    icon for MenuBar - MenuBar from the AWT components tab
  2. Click anywhere in the JFrame, JDialog, or JApplet container to which you want to add the menu bar.

    If this is the first menu bar you have added to the form, the menu bar appears visually on the form.

    If this is not the first menu bar on the form, the menu appears under the Other Components node in the Component Inspector. The menu does not appear visually on the form.

Tip Only the AWT MenuBar can be used as the main menu for AWT forms, and only the Swing JMenuBar can be used as the main menu for Swing forms.
See also
Changing the Current 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