Basics
Guides
API Reference
Basics
Guides
API Reference
[18:7] extends: FxObj
Wraps JavaFX MenuItem, a single selectable item in a Menu or ContextMenu that triggers an action when chosen. Each item displays a text label and optionally an image graphic. Register a click handler with onClick() to respond when the user selects the item. MenuItem is the base type for more specialized items such as CheckMenuItem and RadioMenuItem. MenuItem is not a Node — it inherits directly from Object and implements EventTarget and Styleable. It is consumed by Menu and ContextMenu rather than being placed in the scene graph itself.
MenuItem (string Name, Img = null)
Initializes a new MenuItem with the specified name and optional image.
Name The name displayed on the menu item.Img An optional Image wrapper to display alongside the menu item.this objectadopt (object Ajo)
Wraps an existing javafx.scene.control.MenuItem AussomJavaObject in a MenuItem wrapper without invoking the standard constructor.
Ajo is the AussomJavaObject around a javafx.scene.control.MenuItem instance.A new MenuItem wrapper around the provided object.onClick (callback OnClick)
Sets a callback function to execute when the menu item is clicked.
OnClick The callback function for the click event.this objectsetId (string Id)
Sets the CSS id used to select this menu item in a stylesheet.
Id is the id string, or null to clear.this objectgetId ()
Returns the CSS id assigned to this menu item.
A string with the id, or null when unset.idProperty ()
Returns the id property for binding or change listeners.
An AussomJavaObject around a StringProperty.setStyle (string Style)
Sets the inline CSS style applied to this menu item.
Style is a CSS declaration string, or null to clear.this objectgetStyle ()
Returns the inline CSS style applied to this menu item.
A string with the inline style, or null when unset.styleProperty ()
Returns the style property for binding or change listeners.
An AussomJavaObject around a StringProperty.getParentMenu ()
Returns the Menu that owns this item, or null when the item is detached or owned by a ContextMenu.
An AussomJavaObject around the parent javafx.scene.control.Menu, or null.parentMenuProperty ()
Returns the read-only parentMenu property for change listeners.
An AussomJavaObject around a ReadOnlyObjectPropertygetParentPopup ()
Returns the ContextMenu that owns this item, or null when the item is owned by a Menu or is detached.
An AussomJavaObject around the parent javafx.scene.control.ContextMenu, or null.parentPopupProperty ()
Returns the read-only parentPopup property for change listeners.
An AussomJavaObject around a ReadOnlyObjectPropertysetText (string Text)
Sets the text displayed by the menu item.
Text is the menu item label, or null to clear.this objectgetText ()
Returns the text currently displayed by the menu item.
A string with the label, or null when unset.textProperty ()
Returns the text property for binding or change listeners.
An AussomJavaObject around a StringProperty.setGraphic (object Graphic)
Sets the graphic Node displayed alongside the menu item text.
Graphic is an Aussom wrapper whose .obj holds the javafx.scene.Node.this objectgetGraphic ()
Returns the graphic Node currently shown alongside the menu item text.
An AussomJavaObject around the Node, or null when unset.graphicProperty ()
Returns the graphic property for binding or change listeners.
An AussomJavaObject around an ObjectPropertysetOnAction (object Handler)
Sets the EventHandler invoked when the menu item is selected. Most callers should use
onClick(callback)to register an Aussom callback.
Handler is an AussomJavaObject around a javafx.event.EventHandler.this objectgetOnAction ()
Returns the EventHandler currently registered for the action event.
An AussomJavaObject around the javafx.event.EventHandler, or null when unset.onActionProperty ()
Returns the onAction property for binding or change listeners.
An AussomJavaObject around an ObjectProperty<EventHandlersetOnMenuValidation (object Handler)
Sets the EventHandler invoked when the menu item receives the MENU_VALIDATION_EVENT.
Handler is an AussomJavaObject around a javafx.event.EventHandler.this objectgetOnMenuValidation ()
Returns the EventHandler currently registered for menu validation.
An AussomJavaObject around the javafx.event.EventHandler, or null when unset.onMenuValidationProperty ()
Returns the onMenuValidation property for binding or change listeners.
An AussomJavaObject around an ObjectProperty<EventHandlersetDisable (bool Disable)
Sets whether the menu item is disabled. Disabled items are rendered grayed out and do not respond to user input.
Disable is a bool; true disables the item.this objectisDisable ()
Returns whether the menu item is currently disabled.
A bool that is true when the item is disabled.disableProperty ()
Returns the disable property for binding or change listeners.
An AussomJavaObject around a BooleanProperty.setVisible (bool Visible)
Sets whether the menu item is visible in its parent menu.
Visible is a bool; true shows the item, false hides it.this objectisVisible ()
Returns whether the menu item is currently visible.
A bool that is true when the item is visible.visibleProperty ()
Returns the visible property for binding or change listeners.
An AussomJavaObject around a BooleanProperty.setAccelerator (object Accelerator)
Sets the keyboard accelerator that fires this menu item.
Accelerator is an AussomJavaObject around a javafx.scene.input.KeyCombination.this objectgetAccelerator ()
Returns the keyboard accelerator currently bound to the menu item.
An AussomJavaObject around the KeyCombination, or null when unset.acceleratorProperty ()
Returns the accelerator property for binding or change listeners.
An AussomJavaObject around an ObjectPropertysetMnemonicParsing (bool MnemonicParsing)
Sets whether mnemonic parsing is enabled. When true an underscore in the text marks the next character as a mnemonic accelerator.
MnemonicParsing is a bool; true enables parsing.this objectisMnemonicParsing ()
Returns whether mnemonic parsing is currently enabled.
A bool that is true when mnemonic parsing is active.mnemonicParsingProperty ()
Returns the mnemonicParsing property for binding or change listeners.
An AussomJavaObject around a BooleanProperty.getStyleClass ()
Returns the observable list of CSS style class names applied to this menu item.
An AussomJavaObject around an ObservableListfire ()
Fires the menu item programmatically as if the user had selected it.
this objectbuildEventDispatchChain (object Tail)
Appends this menu item's event handler manager to the given dispatch chain so events routed to the item are processed correctly.
Tail is an AussomJavaObject around the existing EventDispatchChain.An AussomJavaObject around the extended EventDispatchChain.addEventHandler (object EventType, object Handler)
Registers an event handler for the given event type.
EventType is an AussomJavaObject around a javafx.event.EventType value.Handler is an AussomJavaObject around a javafx.event.EventHandler.this objectremoveEventHandler (object EventType, object Handler)
Removes a previously registered event handler for the given event type.
EventType is an AussomJavaObject around a javafx.event.EventType value.Handler is an AussomJavaObject around the javafx.event.EventHandler to remove.this objectaddEventFilter (object EventType, object Handler)
Registers an event filter for the given event type. Filters run before handlers and can consume the event.
EventType is an AussomJavaObject around a javafx.event.EventType value.Handler is an AussomJavaObject around the javafx.event.EventHandler.this objectremoveEventFilter (object EventType, object Handler)
Removes a previously registered event filter for the given event type.
EventType is an AussomJavaObject around a javafx.event.EventType value.Handler is an AussomJavaObject around the javafx.event.EventHandler to remove.this objectgetUserData ()
Returns the user data object previously attached to this menu item.
An AussomJavaObject around the user data value, or null.setUserData (UserData)
Attaches an arbitrary value to this menu item for application use.
UserData is the value to store, or null to clear.this objectgetProperties ()
Returns the observable property map associated with this menu item. The map is created on first access.
An AussomJavaObject around an ObservableMap<Object,Object>.getTypeSelector ()
Returns the CSS type selector used by the JavaFX CSS engine for this menu item (typically "MenuItem").
A string with the type selector.getStyleableParent ()
Returns the Styleable parent used by the CSS engine when resolving inherited properties.
An AussomJavaObject around the parent Styleable, or null when none.getPseudoClassStates ()
Returns the observable set of pseudo-class states currently active on this menu item.
An AussomJavaObject around an ObservableSetgetCssMetaData ()
Returns the CSS metadata describing the styleable properties supported by this menu item.
An AussomJavaObject around a List of CssMetaData entries.getStyleableNode ()
Returns the Node used by the CSS engine to apply styles to this menu item, or null when no rendered node exists yet.
An AussomJavaObject around the javafx.scene.Node, or null.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.