I was wondering if I can set a certain style (e.g. background color to black) for a menu button while the menu of this menu button is currently open. That is, if the menu is not open, then it should not have a black background color. Can I do this in the CSS file or is it even possible?
I know the menu buttons has a method showing
which indicates me, whether the menu is open, but I don't know to apply this, so that the button color changes while the menu is open.
This is the menu button: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/MenuButton.html
I'm using JavaFX and for the styling I'm using CSS.