Skip to main content

JXMonthView - change the way unselectable dates are rendered

3 replies [Last post]
ralderson
Offline
Joined: 2009-02-23

Is there any way to change the way unselectable dates are rendered in the month view. The only property I could find was JXMonthView.unselectableDayForeground but it just changes the color of the different-sized Xs drawn over the dates. I'd prefer to just have the dates drawn grayed-out but I can't seem to find where I could override TextCrossingPainter.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ralderson
Offline
Joined: 2009-02-23

Forgot to mention, but for anybody else who doesn't like the red Xs that are drawn for unselectable dates, I was able to accomplish what I needed to by not setting any unselectable dates, lower or upper bounds and extending DaySelectionModel, overriding the methods that set the date selections.

kleopatra
Offline
Joined: 2003-06-11

the long-term goal is to make all visual properties easily configurable - that's the main reason the painting internally was switched over to use "renderers and highlighters" (there's an open task issue and several previous discussions about that, and maybe the swingx wiki has some links). Currently, we still are on our way with lots of stuff hard-coded .. too raw to open for public access as the (package private) api of all collaboratos definitely will change. If you are daring, have a look into the BasicMonthViewUI and implement a custom RenderingHandler which "highlights" by something else than a textCrossingPainter.

Cheers
Jeanette

ralderson
Offline
Joined: 2009-02-23

Thanks Jeanette. Makes sense. Great stuff btw. Might try to be adventurous!