MenuBar

The following panel contains a menubar on the top and a large text-area. The menubar has only one menu ('Menu'), it has a menuitem ('MenuItem') and a menu ('Menu'). The later's popup contains a menuitem with a selected checkbox ('CheckBox'), a separator, and a radio button ('RadioButton').

<panel columns="1" gap="4">
  <menubar weightx="1">
    <menu text="Menu">
      <menuitem text="MenuItem" icon="image.gif" />
      <menu text="Menu">
        <checkboxmenuitem text="CheckBox" selected="true" />
        <separator />
        <checkboxmenuitem text="RadioButton" group="group"/>
      </menu>
    </menu>
  </menubar>
  <textarea weighty="1" />
</panel>

Properties
NameTypeDefaultDescription
placementchoicetopMenubar may unfold the menus either downwards (default - for menubars placed at the top of the container), or upwards from the menubar position (bottom - for menubars placed at the bottom of the container).
name, enabled, visible, tooltip, property, width, height, colspan, rowspan, weightx, weighty, halign, and valign parameters are similar to component

Menu

Menubar includes menu, and menu could contain menuitems, check or radio button items, separators, and menus.

Properties
NameTypeDefaultDescription
mnemonicinteger-1Specifies the index of the underlined char and the key combination (Alt + underlined character) which selects the menu.
name, enabled, text, icon, alignment, tooltip, and property parameters are similar to combobox choice

MenuItem

A regular menu item can have either text or a graphic icon associated with it, or both.

Properties
NameTypeDefaultDescription
acceleratorkeystroke The key combination which invokes the menuitem's action method without navigating the menu hierarchy.
mnemonicinteger-1Specifies the underlined char index (thus the key combination) which invokes the action listener.
name, enabled, text, icon, alignment, tooltip, and property parameters are similar to combobox choice
Listeners
NameDescription
actionInvokes the given method when the menuitem is pressed by mouse or keyboard.

CheckBoxMenuItem

A menu item that can be selected or deselected. The selected menuitem appears with a checkmark next to it. A radio-button menu-item is a menu item that is part of a group of menu items in which only one item in the group can be selected.

Properties
NameTypeDefaultDescription
selectedbooleanfalseThe state of the checkboxmenuitem.
groupstring Identifies a group if not null. Only one radio menuitem at a time can be selected in a group. User can set on a radio menuitem, the selected menuitem of the group will be set off (the group members is searched only in the same menu).
name, enabled, text, icon, alignment, tooltip, and property parameters are similar to combobox choice
mnemonic, accelerator, and action parameters are described at menuitem
Keyboard-actions
OperationAction
F10Moves focus to menu bar and posts first menu
Up arrowSelects previous item (or the last)
Down arrowSelects next item (or the first)
Left arrowCollapses last popupmenu, or selects previous (or the last) menu of menubar
Right arrowExpands menu, or selects next (or the first) menu of menubar
Enter, Return, SpacebarActivates a menu item, dismisses menu, and goes to last window item with focus
EscapeDismisses menu without taking action and returns focus to last component that had focus