0

I m getting a white background in my ComboBox in javaFx

Screenshot of combobox I m getting

I simply used this

ComboBox mode = new ComboBox();
mode.getItems().addAll("Cash", "Cheque", "Account Transfer");

Please tell me how to resolve this..

Ashish Chauhan
  • 27
  • 1
  • 1
  • 4

1 Answers1

0

As you can read here, when the combo is shown a PopupControl that extends `PopupWindow' is shown. It has its own scene and styling.

My guess is you have some styling applied to the CSS rule .root.popup, something like this:

.root.popup {
    -fx-background-color: white;
}

Try to remove that sytling or change it to:

.root.popup {
    -fx-background-color: transparent;
}

and check if the problem is solved.

Community
  • 1
  • 1
José Pereda
  • 44,311
  • 7
  • 104
  • 132