I have not been able to find API in the JavaFX Menu
class that would allow me to retrieve the parent MenuBar
. Any hints, including the usage of internal API are very welcome. (JavaFX 8)
Background: Usually any JavaFX Node
can give you it's parent with the method getParent()
. But since Menu
and MenuItem
do not inherit from Node
, this possibility is not available. The MenuItem
class (and therefore also the Menu
class) has two similar methods:
getParentPopup()
to get a parentContentMenu
getParentMenu()
to get a parentMenu
So I would have expected something like getParentMenuBar()
, but it's not there.
EDIT: I just found the jira feature request for this API extension: https://bugs.openjdk.java.net/browse/JDK-8091154
Has anybody found a workaround for this?