hideCalendarFrame();
}
};
calendarFrame.addWindowListener(l);
JXPanel calendar = new JXPanel();
calendar.setBackground(Color.WHITE);
Painter<?> painter = createBackgroundPainter();
calendar.setBackgroundPainter(painter);
JXMonthView monthView = new JXMonthView();
Calendar cal = monthView.getCalendar();
cal.set(Calendar.YEAR, 2010);
cal.set(Calendar.MONTH, Calendar.JANUARY);
monthView.setFirstDisplayedDay(cal.getTime());
monthView.setOpaque(false);
monthView.setPreferredColumnCount(3);
monthView.setPreferredRowCount(4);
// old style: set visual property with JXMonthView api
monthView.setDayForeground(Calendar.SUNDAY, Color.MAGENTA);
// <snip> Custom CalendarRenderingHandler
// new style: install a custom renderingHandler
// (as client property, because no public api support yet)
// which allows to add Highlighters
monthView.putClientProperty(DemoMonthViewUI.RENDERING_HANDLER_KEY,
createRenderingHandler());
// </snip>
DemoUtils.setSnippet("Custom CalendarRenderingHandler", monthView);
calendar.add(monthView);
calendarFrame.add(calendar);
Application application = Application.getInstance(Application.class);
if (application instanceof SingleFrameApplication) {
((SingleFrameApplication) application).show(calendarFrame);
} else {