I\'ve placed at the top of a BorderPane
a MenuBar
with a \"File\" Menu and a \"Close\" MenuItem
inside:
How can I mak
Adding the following selectors to you stylesheet reduces the height of each menu element:
.menu-item { -fx-padding: 1 5 1 5; }
.menu { -fx-padding: 1 5 1 5; }
To remove the padding of all context menus, you can additionally add:
.menu .context-menu { -fx-padding: 1 1 1 1; }
And you can also decrease the font size:
.menu-item >.label {-fx-font-size:9;}
.menu >.label {-fx-font-size:9;}
Furthermore you can remove the left right padding of the MenuBar
and decrease the spacing:
.menu-bar {
-fx-padding: 0 1 0 1;
-fx-spacing: 1;
};