Reputation: 893
I am trying to create a GUI in JavaFx. My problem is that I am receiving warning with my CSS style. In fact my warnings are:
WARNING: CSS Error parsing '{-fx-font: 90 Langdon; -fx-base: #AE3522; -fx-text-fill: white; bold;}: WARNING: CSS Error parsing '{-fx-font: 60 Langdon; -fx-text-fill: white; bold; -fx-base: #AE3522 bold;}:
This CSS is assignig to my buttons and Labels:
learnin = new Label(" Puzzle ");
learnin.setStyle("-fx-font: 90 Langdon; -fx-base: #AE3522; -fx-text-fill: white; bold;");
Upvotes: 1
Views: 3138
Reputation: 21809
Try it like this ...
learnin.setStyle("-fx-font: 90 Langdon; "
+ "-fx-base: #AE3522; "
+ "-fx-text-fill: white; "
+ "-fx-font-weight:bold;");
... or shorter ...
learnin.setStyle("-fx-font: normal bold 90 Langdon; "
+ "-fx-base: #AE3522; "
+ "-fx-text-fill: white;");
This part is invalid: -fx-text-fill: white; bold;
You can check the JavaFX CSS Reference to check how you can style fonts.
Upvotes: 3