The standard menu items do not support this feature.
You can use this code to create custom menu items:
B4X:
Sub CustomMenu_MouseClicked (EventData As MouseEvent)
Dim lbl As Label = Sender
Log($"Clicked: ${lbl.Text}"$)
End Sub
Sub CreateCustomMenuItem (Text As String, Tooltip As String) As MenuItem
Dim lbl As Label
lbl.Initialize("CustomMenu")
lbl.Text = Text
lbl.TooltipText = Tooltip
Dim CustomMenuItem As JavaObject
CustomMenuItem.InitializeNewInstance("javafx.scene.control.CustomMenuItem", Array(lbl))
Return CustomMenuItem
End Sub
Usage:
B4X:
Dim FileMenu As Menu = MenuBar1.Menus.Get(0)
FileMenu.MenuItems.Add(CreateCustomMenuItem("Custom Text", "Custom Tooltip"))
FileMenu.MenuItems.Add(CreateCustomMenuItem("Custom Text2", "Custom Tooltip2"))