0
votes

I am currently using jfoenix's combobox but my problem is that I can't edit the prompt text color inside of it. It keeps using the default color grey. How can I change the font color of the combobox from grey to white? Is there any way to do this in css?

This is how it looks like: enter image description here

I hope you can help me out with this.

Thank you in advance.

2

2 Answers

5
votes

I am answering my own question for other people's reference. For some reason the font color of the Jfoenix combobox wasn't editable in css. So what I did instead is used the standard combobox provided and simply changed the css to make it look like the Jfoenix combobox.

This is the css style I used for combo-box:

.combo-box,
.choice-box {
    -fx-font-size: 12px;
    -fx-prompt-text-fill: black;
    -fx-text-fill: black;
    -fx-background-color: none;
    -fx-border-width: 0 0 1 0;
    -fx-border-color: #bdbdbd;
    -fx-padding: 0 0 3 -8;
}

.combo-box .list-cell:filled:selected .text,
.choice-box .list-cell:filled:selected .text {
    -fx-fill: black;
}

.combo-box .arrow,
.choice-box .arrow {
    -fx-background-color: #4d4d4d;   
}
3
votes

I figured it out. You just need to add the following line to a css file overriding the jfoenix css.

.jfx-combo-box {
-fx-prompt-text-fill: white;
}