Reputation: 1090
Iam trying to change the TextColor of an ChoiceBox in JavaFX.
This is my css file:
.choice-box{
-fx-background-color:
#000000,
linear-gradient(#7ebcea, #2f4b8f),
linear-gradient(#426ab7, #263e75),
linear-gradient(#395cab, #223768);
-fx-padding: 3 10 4 20;
-fx-text-fill: white;
-fx-font-size: 12px;
}
And this is a screenshot of my choice-box:
-fx-text-fill: white;
works on buttons but not on choic boxes. Why?
How can i change the color of the text in the choicebox?
Upvotes: 3
Views: 8528
Reputation: 1093
i think you can do:
.choice-box .label {
-fx-text-fill: white;
}
Upvotes: 7
Reputation: 1900
You should give these properties to the listcell and not the choice-box. Refer this : http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#labeled
Hope it helps
Upvotes: 1