Reputation: 79
I am working on small JavaFX project. This time I want to change font of text shown on my buttons. I tried to do this like this:
Button button = new Button("Not formatted text");
Font font = new Font(40); //Button font's size should increase to 40
button.setFont(font);
but it simply doesn't work - size remains same as before. Also it looks like there is no simmilar method to achieve this. How to change font of text on JavaFX button? I know that this question looks kind of trivial, but, seriously, I spent almost 1,5h looking for this and I am giving up. Please, help me :(
Upvotes: 2
Views: 13965