Basics
Guides
API Reference
Basics
Guides
API Reference
[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.
| Pseudo-class | Description |
|---|---|
showing |
Applies while the Menu popup is open and its items are visible. |
Menu (string Name)
Initializes a new Menu instance with the specified name.
Name The name displayed on the menu.this objectadd (Items)
Adds one or more Menu or MenuItem objects to this Menu.
Items Either a single Menu/MenuItem or a list of them to add.this objectisShowing ()
Returns whether the menu popup is currently visible.
A bool that is true when the popup is showing.showingProperty ()
Returns the read-only showing property for binding or change listeners.
An AussomJavaObject around a ReadOnlyBooleanProperty.onShowingProperty ()
Returns the onShowing property for binding or change listeners.
An AussomJavaObject around an ObjectProperty<EventHandlersetOnShowing (callback Cb)
Registers a callback invoked just before the menu popup becomes visible.
Cb is a callback function invoked with the Event AJO.this object for chaininggetOnShowing ()
Returns the current onShowing EventHandler AJO.
An AussomJavaObject around the EventHandler, or null.onShownProperty ()
Returns the onShown property for binding or change listeners.
An AussomJavaObject around an ObjectProperty<EventHandlersetOnShown (callback Cb)
Registers a callback invoked when the menu popup is shown.
Cb is a callback function invoked with the Event AJO.this object for chaininggetOnShown ()
Returns the current onShown EventHandler AJO.
An AussomJavaObject around the EventHandler, or null.onHidingProperty ()
Returns the onHiding property for binding or change listeners.
An AussomJavaObject around an ObjectProperty<EventHandlersetOnHiding (callback Cb)
Registers a callback invoked just before the menu popup hides.
Cb is a callback function invoked with the Event AJO.this object for chaininggetOnHiding ()
Returns the current onHiding EventHandler AJO.
An AussomJavaObject around the EventHandler, or null.onHiddenProperty ()
Returns the onHidden property for binding or change listeners.
An AussomJavaObject around an ObjectProperty<EventHandlersetOnHidden (callback Cb)
Registers a callback invoked when the menu popup has been hidden.
Cb is a callback function invoked with the Event AJO.this object for chaininggetOnHidden ()
Returns the current onHidden EventHandler AJO.
An AussomJavaObject around the EventHandler, or null.getItems ()
Returns the observable list of child MenuItems contained in this menu.
An AussomJavaObject around an ObservableListshow ()
Shows the menu popup.
this object for chaininghide ()
Hides the menu popup.
this object for chaining
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.