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