JavaFX: How to increase the size of the text without increasing the size of the container (shortcut, button)?

I would just like to have the text inside Buttonto fill in more Buttonor increase the font size with the button without increasing its size.

I tried to use a negative complement, but it does not give the desired result.

+4
source share
1 answer

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

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

enter image description here

+4
source

Source: https://habr.com/ru/post/1686951/


All Articles