JavaFX: How to increase text size without increasing container (Label, Button) size?

Viewed 468

I would like to simply have the text inside a Button to fill more of the Button or increase the font size in a button without increasing its size.

I tried using negative padding but it does not give the desired result.

1 Answers

You can simply remove the padding using the -fx-padding property:

.button {
    -fx-padding: 0;
    -fx-font-size: 20;
}

enter image description here

Related