How to change the style of the calendar in the DatePicker in JavaFX 8? I looked in all the default styles in modena file and i don't find the classes of the DatePicker. Anyone knows how to do it? For example, change the header color to blue.
The default style is the following:
You can find the css for the DatePicker
control under .date-picker
and .date-picker-popup
style classes on the modena.css file.
If you want to change the header (I guess you mean the upper pane with Month and Year), this is what you need:
.date-picker-popup > .month-year-pane {
-fx-padding: 0.588883em 0.5em 0.666667em 0.5em; /* 7 6 8 6 */
-fx-background-color: derive(-fx-box-border,30%),
linear-gradient(to bottom, derive(-fx-base,-3%),
derive(-fx-base,5%) 50%,
derive(-fx-base,-3%));
-fx-background-insets: 0 0 0 0, 0 0 1 0;
}
You just need to add this style class to your css file, and change -fx-base
to the color you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With