Documentation

Menu Designer

The menu designer makes it easy to create and modify menu bars and popup menus. It supports in-place-editing menu texts and drag-and-drop menu items.

Menu bar structure

The following figure shows the structure of a menu bar. The horizontal bar on top of the image is a JMenuBar that contains JMenu components. The JMenu contains JMenuItem, JCheckBoxMenuItem, JRadioButtonMenuItem or Menu Separator components. To create a sub-menu, put a JMenu into a JMenu.

Menu structure

The component palette has a category "Menus" that contains all components necessary to create menus.

Creating menu bars

To create a menu bar:

  1. add a JMenuBar to a JFrame
  2. add JMenus to the JMenuBar and
  3. add JMenuItems to the JMenus

Select the necessary components in the Palette and drop them to the Design view.

Menu bar Menu bar Menu bar
Menu bar Menu barMenu bar

You can freely drag and drop the various menu components to rearrange them.

Creating popup menus

To create a popup menu:

  1. add a JPopupMenu to the free area in the Design view and
  2. add JMenuItems to the JPopupMenu

Popup Menu

Assign popup menus to components

If you use Java 5 or later, you can assign the popup menu to a component in the properties view using the "componentPopupMenu" property. Select the component to which you want attach the popup menu and assign it in the Properties view. Note that you must click on the Show Advanced Properties in the toolbar of the Properties view to see the property.

Attach popup menu

Note that JFormDesigner must run on Java 5 to use the "componentPopupMenu" property. Open the JFormDesigner About dialog and check whether it displays "Java 1.5.x".