JavaFX choicebox text color


Iam trying to change the TextColor of an ChoiceBox in JavaFX.

This is my css file:

        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:

enter image description here

-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?

11/13/2013 3:10:18 PM

Accepted Answer

i think you can do:

.choice-box .label {
     -fx-text-fill: white; 
11/29/2013 10:31:54 AM

You should give these properties to the listcell and not the choice-box. Refer this :

Hope it helps

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow