1

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;");

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.