Search code examples
cssjavafxjavafx-datepicker

Change the default green color of JFXDatePicker


The default color for JFXDatePicker seems to be green. How do I change it to a different color, lets say red?

enter image description here

I tried the following but they seem to change colors of different elements

  1. -fx-background-color : This only changed the input background color enter image description here
  2. -fx-control-inner-background : This changed the white background to red but does not change the currently green part. enter image description here

Could you please help me out what style do we need to apply to change the green color.


Solution

  • This will change the month-year-pane to red color:

    .date-picker-popup > .month-year-pane {
        -fx-background-color: red;
    }