View Single Post
Old 03-03-2009, 09:50   #4
banryu79
Senior Member
 
L'Avatar di banryu79
 
Iscritto dal: Oct 2007
Città: Padova
Messaggi: 4131
Quote:
Originariamente inviato da Fire Fox II Guarda i messaggi
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".
__________________

As long as you are basically literate in programming, you should be able to express any logical relationship you understand.
If you don’t understand a logical relationship, you can use the attempt to program it as a means to learn about it.
(Chris Crawford)
banryu79 è offline   Rispondi citando il messaggio o parte di esso