dayChooser
protected JDayChooser dayChooser
the day chooser
locale
protected Locale locale
the locale
maxSelectableDate
protected Date maxSelectableDate
minSelectableDate
protected Date minSelectableDate
monthChooser
protected JMonthChooser monthChooser
the month chooser
weekOfYearVisible
protected boolean weekOfYearVisible
indicates if weeks of year shall be visible
yearChooser
protected JYearChooser yearChooser
the year chhoser
JCalendar
public JCalendar()
Default JCalendar constructor.
JCalendar
public JCalendar(Calendar calendar)
JCalendar constructor which allows the initial calendar to be set.
JCalendar
public JCalendar(Date date)
JCalendar constructor which allows the initial date to be set.
JCalendar
public JCalendar(Date date,
Locale locale)
JCalendar constructor specifying both the initial date and locale.
date
- the datelocale
- the new locale
JCalendar
public JCalendar(Date date,
Locale locale,
boolean monthSpinner,
boolean weekOfYearVisible)
JCalendar constructor with month spinner parameter.
date
- the datelocale
- the localemonthSpinner
- false, if no month spinner should be usedweekOfYearVisible
- true, if weeks of year shall be visible
JCalendar
public JCalendar(Date date,
boolean monthSpinner)
JCalendar constructor specifying both the initial date and the month
spinner type.
date
- the datemonthSpinner
- false, if no month spinner should be used
JCalendar
public JCalendar(Locale locale)
JCalendar constructor allowing the initial locale to be set.
JCalendar
public JCalendar(Locale locale,
boolean monthSpinner)
JCalendar constructor specifying both the locale and the month spinner.
locale
- the localemonthSpinner
- false, if no month spinner should be used
JCalendar
public JCalendar(boolean monthSpinner)
JCalendar constructor specifying the month spinner type.
monthSpinner
- false, if no month spinner should be used
getCalendar
public Calendar getCalendar()
Returns the calendar property.
- the value of the calendar property.
getDate
public Date getDate()
Returns a Date object.
- a date object constructed from the calendar property.
getDayChooser
public JDayChooser getDayChooser()
Gets the dayChooser attribute of the JCalendar object
getDecorationBackgroundColor
public Color getDecorationBackgroundColor()
Returns the color of the decoration (day names and weeks).
- the color of the decoration (day names and weeks).
getLocale
public Locale getLocale()
Returns the locale.
- the value of the locale property.
getMaxDayCharacters
public int getMaxDayCharacters()
Gets the maximum number of characters of a day name or 0. If 0 is
returned, dateFormatSymbols.getShortWeekdays() will be used.
- the maximum number of characters of a day name or 0.
getMaxSelectableDate
public Date getMaxSelectableDate()
Gets the minimum selectable date.
- the minimum selectable date
getMinSelectableDate
public Date getMinSelectableDate()
Gets the maximum selectable date.
- the maximum selectable date
getMonthChooser
public JMonthChooser getMonthChooser()
Gets the monthChooser attribute of the JCalendar object
getSundayForeground
public Color getSundayForeground()
Returns the Sunday foreground.
- Color the Sunday foreground.
getWeekdayForeground
public Color getWeekdayForeground()
Returns the weekday foreground.
- Color the weekday foreground.
getYearChooser
public JYearChooser getYearChooser()
Gets the yearChooser attribute of the JCalendar object
isDecorationBackgroundVisible
public boolean isDecorationBackgroundVisible()
Gets the visibility of the decoration background.
- true, if the decoration background is visible.
isDecorationBordersVisible
public boolean isDecorationBordersVisible()
Gets the visibility of the decoration border.
- true, if the decoration border is visible.
isEnabled
public boolean isEnabled()
Returns true, if enabled.
isWeekOfYearVisible
public boolean isWeekOfYearVisible()
Indicates if the weeks of year are visible..
- boolean true, if weeks of year are visible
main
public static void main(String[] s)
Creates a JFrame with a JCalendar inside and can be used for testing.
s
- The command line arguments
propertyChange
public void propertyChange(PropertyChangeEvent evt)
JCalendar is a PropertyChangeListener, for its day, month and year
chooser.
evt
- the property change event
setBackground
public void setBackground(Color bg)
Sets the background color.
setCalendar
public void setCalendar(Calendar c)
Sets the calendar property. This is a bound property.
setDate
public void setDate(Date date)
Sets the date. Fires the property change "date".
setDecorationBackgroundColor
public void setDecorationBackgroundColor(Color decorationBackgroundColor)
Sets the background of days and weeks of year buttons.
decorationBackgroundColor
- the background color
setDecorationBackgroundVisible
public void setDecorationBackgroundVisible(boolean decorationBackgroundVisible)
Sets the decoration background visible.
decorationBackgroundVisible
- true, if the decoration background should be visible.
setDecorationBordersVisible
public void setDecorationBordersVisible(boolean decorationBordersVisible)
Sets the decoration borders visible.
decorationBordersVisible
- true, if the decoration borders should be visible.
setEnabled
public void setEnabled(boolean enabled)
Enable or disable the JCalendar.
enabled
- the new enabled value
setFont
public void setFont(Font font)
Sets the font property.
setForeground
public void setForeground(Color fg)
Sets the foreground color.
setLocale
public void setLocale(Locale l)
Sets the locale property. This is a bound property.
setMaxDayCharacters
public void setMaxDayCharacters(int maxDayCharacters)
Sets the maximum number of characters per day in the day bar. Valid
values are 0-4. If set to 0, dateFormatSymbols.getShortWeekdays() will be
used, otherwise theses strings will be reduced to the maximum number of
characters.
maxDayCharacters
- the maximum number of characters of a day name.
setMaxSelectableDate
public void setMaxSelectableDate(Date max)
Sets the maximum selectable date.
max
- maximum selectable date
setMinSelectableDate
public void setMinSelectableDate(Date min)
Sets the minimum selectable date.
min
- minimum selectable date
setSelectableDateRange
public void setSelectableDateRange(Date min,
Date max)
Sets a valid date range for selectable dates. If max is before
min, the default range with no limitation is set.
min
- the minimum selectable date or null (then the minimum date is
set to 01\01\0001)max
- the maximum selectable date or null (then the maximum date is
set to 01\01\9999)
setSundayForeground
public void setSundayForeground(Color sundayForeground)
Sets the Sunday foreground.
sundayForeground
- the sundayForeground to set
setWeekOfYearVisible
public void setWeekOfYearVisible(boolean weekOfYearVisible)
Sets the week of year visible.
weekOfYearVisible
- true, if weeks of year shall be visible
setWeekdayForeground
public void setWeekdayForeground(Color weekdayForeground)
Sets the weekday foreground.
weekdayForeground
- the weekdayForeground to set