javafxhighlightjfxtras

jfxtras LocalDatePicker. How to highlight Date


I'm using jfxtras 8.0.r5 library and I have to pre-highlight some LocalData that become from another part of the program so user can see which data are important.

so I use this:

LocalDatePicker lLocalPickerADI = new LocalDatePicker();

And I put into a Grid and it correctly appear:

Grid_Date.add(lCalendarPickerADI,0,1);

I have this Observable List where I have the data that I want pre-higlight:

public  ObservableList<LocalDate> ADI_DATE=FXCollections.observableArrayList();

filled and passed from other part of code.

So my question is: How I can pre-highligt on the LocalDatePicker? I need to do this from code and not from UI.

sorry if I'm not clear. Thanks in advance!


Solution

  • JFXtras LocalDatePicker has a highlightedLocalDates list, in that you can put the to-be-highlighted dates. If you have (too) many of them, you can use the localDateRangeCallback to populate only the required dates for a displayed range.

    http://jfxtras.org/doc/8.0/jfxtras-controls/jfxtras/scene/control/LocalDatePicker.html