2

I tested Java 8u40. I get error when I run this part of the code:

setStyle("-fx-background-color: linear-gradient(to bottom, #FAFAFA, #EAEAEA);"
            + " -fx-border: 2px solid; -fx-border-color: white;");

X 15, 2014 10:33:53 PM com.sun.javafx.css.parser.CSSParser declaration
WARNING: CSS Error parsing '*{-fx-background-color: linear-gradient(to bottom, #FAFAFA, #EAEAEA); -f
x-border: 2px solid; -fx-border-color: white;}: expected series of <size> while parsing '-fx-border'
 at [1,82]

Is this a bug or css code is wrong?

2 Answers 2

4

You should define every border property for itself as specified in "JavaFX CSS Reference Guide".

-fx-border-width: 2px;
-fx-border-style: solid;
-fx-border-color: white;

Instead of

-fx-border: 2px solid white; 

or

-fx-border: 2px solid; -fx-border-color: white;
Sign up to request clarification or add additional context in comments.

Comments

0

Look's like problem with -fx-border. Maybe you need to specify a full shorthand '-fx-border' property. Try to set:

-fx-border: 2px solid white;

Instead of

-fx-border: 2px solid; -fx-border-color: white;

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.