How can I style a ComboBox
"body" part not the dropdown?
As you can see on the screenshot I want to style just that part where you click and opens the dropdown and the dropdown should remain as it is.
If I try for example:
.combo-box-base .list-cell{
-fx-background-color: red;
}
everything goes red not just what I want.
I had a look at this question: Javafx combobox styling but it didnt really helped me, it styles everything but not that specific part I need.
I have also looked with ScenicView, and I could locate it and add as style: -fx-background-color: red
and it worked, but from code I could't manage it.
In ScenicView I saw the ComboBox has three components:
a StackPane
a ListView
and a ListCell
. I want to style just the ListCell
part.
Here is how it looks like if I add those line in my.css
:
As you can see I don't want the dropdown to be styled.
How can I solve it.
Note: the arrow should remain as it is, just that part where the text is shown, as the second screenshot shows.