Hi JavaFX Stylesheet expert,
How do I remove the default arrow on JavaFX menuButton.
I have figured how to change the color and make in unvisible with
.menu-button {
-fx-mark-color: transparent;
}
or
.menu-button .arrow {
-fx-background-color: transparent;
}
but, I don't want the gap because of the unvisible arrow.
Thanks for your advice.
Best Regards,
Ivan
There are several ways to do this, here are four. The code is Jython with JavaFX. You can edit it for your needs.
EG #1
EG#2
Don't configure the ComboBox Arrow by CSS, instead, do it programmatically and change the Regions SVG Shape
Configure the ComboBox Arrow by CSS and change the Regions SVG Shape
Configure the ComboBox Arrow by CSS but instead, merely hide the arrow by setting the transparency/opacity values and set a background.
Don't configure the ComboBox Arrow by CSS, instead, do it programmatically and merely hide the arrow by setting the transparency/opacity values and set a background.
If we look into the source code of
MenuButtonSkinBase
, the sub structure ofMenuButton
seems to beSo to hide the "arrow" it is enough to set padding to 0 for both StackPanes: