Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: Menu

[22:7] extends: MenuItem

The Menu class wraps the JavaFX Menu control, a popup list of selectable items that is added to a MenuBar or nested inside another Menu as a submenu. Menu extends MenuItem, which means it inherits click-event support and optional graphic icons alongside its text label. When a user clicks a Menu entry in the bar it opens and displays its child MenuItems or nested Menus. The showing pseudo-class is applied automatically by JavaFX while the menu popup is open, allowing stylesheet rules to change appearance during that state.

CSS Pseudo-classes -- Menu

Pseudo-class Description
showing Applies while the Menu popup is open and its items are visible.

Methods

  • Menu (string Name)

    Initializes a new Menu instance with the specified name.

    • @p Name The name displayed on the menu.
    • @r this object
  • add (Items)

    Adds one or more Menu or MenuItem objects to this Menu.

    • @p Items Either a single Menu/MenuItem or a list of them to add.
    • @r this object