I am able to change the color of a JFXDatePicker
from the JFoenix library for certain dates via the code below.
final Callback<DatePicker, DateCell> dayCellFactory = new Callback<DatePicker, DateCell>() {
@Override
public DateCell call(final DatePicker datePicker) {
return new DateCell() {
@Override
public void updateItem(LocalDate item, boolean empty) {
super.updateItem(item, empty);
if(!empty) {
if(listRegisteredTOTDays.contains(item)) {
setStyle("-fx-background-color: #99e699;");
}
}
}
};
}
};
The problem occurs when I have hovered over the item with a changed background. It changes the background colour to the default one after hovering and not the set one via de code above. I do not want to disable the cell as the user still must be able to click on it! The exercise is to inform the user which dates already has data. So nothing can be disabled. How to overcome this? I just want after hovering it gets back the color set as above.