0

I would like to remove the arrow from a single menu button by using CSS:

MenuButton menuButton = new MenuButton();
menuButton.getStyleClass().add("menuButtonWOarrow");

I found Remove arrow on JavaFX menuButton but that is taking affect on all menu buttons.

How would be the correct definition for this in CSS please?

.menuButtonWOarrow{
...
}

Edit - Thanks to James comment, this is working:

.menuButtonWOarrow > .arrow-button > .arrow {
 -fx-padding: 0;
}
JTfx
  • 43
  • 4
  • 3
    Just use the CSS class you defined, `.menuButtonWOarrow` in place of the `.menu-button` CSS class in the CSS code in the accepted answer. Then it will apply only to the menu buttons you give that class name, not to all menu buttons. Post a [mre] if it's not working the way you want. – James_D May 17 '23 at 16:13

0 Answers0