I have stored the default font type and size of my application in a CSS file which I apply using the code:
label.getStyleClass().add("labelStyleClass");
However I also added the feature that if the user provides its own preference, it should override the default settings (set above) and use the user provided font size:
double userSize = readFromFile;
label.setFont(new Font(userSize));
In this case the label.setFont()
call does not set the new size given by user. When I comment out the initial CSS code, the later works.
Any workaround?
Note: cross-posted at JavaFX forum