I'm working on JXdatepicker and i can't modify the red color of unselectable dates,
I found a subject about it, but it doesn't working "setting the following UIDefaults
property JXMonthView.unselectableDayForeground
any help please,
I'm working on JXdatepicker and i can't modify the red color of unselectable dates,
I found a subject about it, but it doesn't working "setting the following UIDefaults
property JXMonthView.unselectableDayForeground
any help please,
since i am in hurry to answer this
but you can use the swingx source code from here https://github.com/cuba-platform/swingx-core/tree/master/src/main/java/org/jdesktop/swingx
then go to the function initMonthview in JXDatepicker.java overwrite it with this one Color.Black you can use your own color. This fix the problem when you have a plaf with the jlabel text color as white and it hides with the background color of JXdatepicker.
private void initMonthView() {
_monthView = new JXMonthView();
// _monthView.setSelectionModel(new SingleDaySelectionModel());
_monthView.setTraversable(true);
_monthView.addPropertyChangeListener(getMonthViewListener());
_monthView.setDayForeground(Calendar.SUNDAY, Color.black);
_monthView.setDayForeground(Calendar.MONDAY, Color.black);
_monthView.setDayForeground(Calendar.TUESDAY, Color.black);
_monthView.setDayForeground(Calendar.WEDNESDAY, Color.black);
_monthView.setDayForeground(Calendar.THURSDAY, Color.black);
_monthView.setDayForeground(Calendar.FRIDAY, Color.black);
_monthView.setDayForeground(Calendar.SATURDAY, Color.black);
}
and then set the color you like then export it as a jar have fun.
or rather you can do a hard job of pluggable Look and Feel.
alternatively you can create a new constructor in the JXDatepicker.java which takes the object of JXMonthview with the particular set of colors
means create a object of
_monthView = new JXMonthView();
// _monthView.setSelectionModel(new SingleDaySelectionModel());
_monthView.setTraversable(true);
_monthView.addPropertyChangeListener(getMonthViewListener());
_monthView.setDayForeground(Calendar.SUNDAY, Color.black);
_monthView.setDayForeground(Calendar.MONDAY, Color.black);
_monthView.setDayForeground(Calendar.TUESDAY, Color.black);
_monthView.setDayForeground(Calendar.WEDNESDAY, Color.black);
_monthView.setDayForeground(Calendar.THURSDAY, Color.black);
_monthView.setDayForeground(Calendar.FRIDAY, Color.black);
_monthView.setDayForeground(Calendar.SATURDAY, Color.black);
now add
create a new constructor like
JXDatepicker(JXMonthView temp){
_monthview = temp;
JXDatepicker();
}
export it as jar use it.