Quote:
Originariamente inviato da Fire Fox II
Infatti è lo stesso 
Che sia l'unico calendar free?
Vabbè, cmq sapresti aiutarmi?
Ho completato il programma, mi rimane solo questo... 
|
Di per se quel componente "andrebbe" usato così com'e.
Comunque l'ho aperto in NetBeans e ci ho smanettato un po' per scoprire se ci sono dei metodi dal nome "promettente" da chiamare, e su quale component interno al DateControl.
Prima devi mettere le mani sul JDayChooser:
Codice:
// DateControl -> JDateChooser -> JCalendar -> JDayChooser
JDateChooser dch = (JDateChooser) dateControl1.getComponent(0);
JCalendar jcal = dch.getJCalendar();
JDayChooser jdc = jcal.getDayChooser();
Poi puoi agire su alcune proprietà, relativamente ai colori, e in particolare a quelli dei bottoni dei giorni:
Codice:
// Component Background and Foreground: come al solito
Color jdcBackground = jdc.getBackground();
jdc.setBackground(jdcBackground);
Color jdcForeground = jdc.getForeground();
jdc.setForeground(jdcForeground);
// days color: (workdays/sunday)
Color workdayForeground = jdc.getWeekdayForeground();
jdc.setWeekdayForeground(workdayForeground);
Color sundayForeground = jdc.getSundayForeground();
jdc.setSundayForeground(sundayForeground);
// day border (visible/invisible)
jdc.isDayBordersVisible();
jdc.setDayBordersVisible(true);
// Background decoration and color
jdc.isDecorationBackgroundVisible();
jdc.setDecorationBackgroundVisible(true);
Color decorationBack = jdc.getDecorationBackgroundColor();
jdc.setDecorationBackgroundColor(decorationBack);
Pare che tu possa dare il colore solo ai "giorni lavorativi" e alla "domenica".