public class Calendar

  1. Object
  2. Component
  3. Container
  4. Calendar

ImplementsActionSource, Animation, Editable, Iterable<Component>, StyleListener

Date widget for selecting a date/time value.

To localize strings for month names use the values “Calendar.Month” using the 3 first characters of the month name in the resource localization e.g. “Calendar.Jan”, “Calendar.Feb” etc…

To localize strings for day names use the values “Calendar.Day” in the resource localization e.g. “Calendar.Sunday”, “Calendar.Monday” etc…

Note that we recommend using the com.codename1.ui.spinner.Picker class which is superior when running on the device for most use cases.

Form hi = new Form("Calendar", new BorderLayout());
Calendar cld = new Calendar();
cld.addActionListener((e) -> Log.p("You picked: " + new Date(cld.getSelectedDay())));
hi.add(BorderLayout.CENTER, cld);

Constructors

public Calendar(long time)Creates a new instance of Calendar set to the given date based on time since epoch (the Date convention)
public Calendar()Constructs a calendar with the current date and time
public Calendar(long time, TimeZone tmz)Creates a new instance of Calendar set to the given date based on time since epoch (the Date convention)
public Calendar(Image leftArrowImage, Image rightArrowImage)Constructs a calendar with the current date and time with left and right images set
public Calendar(long time, TimeZone tmz, Image leftArrowImage, Image rightArrowImage)Creates a new instance of Calendar set to the given date based on time since epoch (the Date convention)

Methods

public long getSelectedDay()Returns the time for the current calendar.
public Date getDate()Return the date object matching the current selection
public void setDate(Date d)Sets the current date in the view and the selected date to be the same.
public void setYearRange(int minYear, int maxYear)Sets the Calendar min and max years
public void setSelectedDate(Date d)This method sets the Calendar selected day
public Date getCurrentDate()Returns the currently viewed date (as opposed to the selected date)
public void setCurrentDate(Date d)Sets the Calendar view on the given date, only the the month and year are being considered.
public TimeZone getTimeZone()Gets the Calendar timezone
public void setTimeZone(TimeZone tmz)Sets the Calendar timezone, if not specified Calendar will use the default timezone
public Style getMonthViewSelectedStyle()Gets the selected style of the month view component within the calendar
public void setMonthViewSelectedStyle(Style s)Sets the selected style of the month view component within the calendar
public Style getMonthViewUnSelectedStyle()Gets the un selected style of the month view component within the calendar
public void setMonthViewUnSelectedStyle(Style s)Sets the un selected style of the month view component within the calendar
public void addActionListener(ActionListener l)Fires when a change is made to the month view of this component
public void removeActionListener(ActionListener l)Fires when a change is made to the month view of this component
public void addMonthChangedListener(ActionListener l)Fires when a new month is selected
public void removeMonthChangedListener(ActionListener l)Fires when a new month is selected
public void addDayActionListener(ActionListener l)Adds an ActionListener to the day buttons.
public void removeDayActionListener(ActionListener l)Removes ActionListener from day buttons
public void addDataChangedListener(DataChangedListener l)Allows tracking selection changes in the calendar in real time
public void removeDataChangedListener(DataChangedListener l)Allows tracking selection changes in the calendar in real time
public void addDataChangeListener(DataChangedListener l)Deprecated Allows tracking selection changes in the calendar in real time
public void removeDataChangeListener(DataChangedListener l)Deprecated Allows tracking selection changes in the calendar in real time
public boolean isChangesSelectedDateEnabled()This flag determines if selected date can be changed by selecting an alternative date
public void setChangesSelectedDateEnabled(boolean changesSelectedDateEnabled)This flag determines if selected date can be changed by selecting an alternative date
protected Button createDay()Deprecated This method creates the Day Button Component for the Month View
protected Label createDayTitle(int day)This method creates the Day title Component for the Month View
protected void updateButtonDayDate(Component dayButton, int year, int currentMonth, int day)This method updates the Button day.
protected void updateButtonDayDate(Component dayButton, int currentMonth, int day)This method updates the Button day.
protected void updateButtonDayDate(Button dayButton, int year, int currentMonth, int day)Deprecated This method updates the Button day.
protected void updateButtonDayDate(Button dayButton, int currentMonth, int day)Deprecated This method updates the Button day.
public boolean isTwoDigitMode()When set to true days will be rendered as 2 digits with 0 preceding single digit days
public void setTwoDigitMode(boolean twoDigitMode)When set to true days will be rendered as 2 digits with 0 preceding single digit days
public Collection<Date> getSelectedDays()Gets the dates selected on the calendar or null if no date is selected
public void setSelectedDays(Collection<Date> selectedDays)Sets the dates to be selected on the calendar
public void setSelectedDays(Collection<Date> selectedDays, String uiid)Sets the dates to be selected on the calendar with a custom uiid.
public String getSelectedDaysUIID()
public void setSelectedDaysUIID(String uiid)Sets the selectedDays UIID to the given uiid.
public void highlightDate(Date date, String uiid)Highlights a date on the calendar using the supplied uiid.
public void highlightDates(Collection<Date> dates, String uiid)Highlights dates on the calendar using the supplied uiid.
public void unHighlightDates(Collection<Date> dates)Un-highlights dates on the calendar by removing the highlighting uiid.
public void unHighlightDate(Date date)Un-highlights dates on the calendar by removing the highlighting uiid.
public boolean isMultipleSelectionEnabled()If true multiple days can be selected on a calendar and “getSelectedDays()” will return the dates selected
public void setMultipleSelectionEnabled(boolean multipleSelectionEnabled)When set to true multiple days can be selected on a calendar and “getSelectedDays()” will return the dates selected
protected Component createDayComponent()Creates a day within the Calendar, this method is protected allowing Calendar to be subclassed to replace the rendering logic of individual day buttons.
protected void bindDayListener(Component cmp, ActionListener l)Since a day may be any component type, developers should override this method to add support for binding the click listener to the given component.
protected void setDayText(Component cmp, String text)Since a day may be any component type, developers should override this method to add support for setting the displayed string.
protected String getDayText(Component cmp)Since a day may be any component type, developers should override this method to add support for removing the click listener from the given component.
protected void setDayUIID(Component cmp, String uiid)Since a day may be any component type, developers should override this method to add support for setting the right component’s UIID.
protected void setDayEnabled(Component cmp, boolean enable)Since a day may be any component type, developers should override this method to add support for enabling or disabling the right component.

Inherited fields

Inherited methods

From Container

encloseIn, encloseIn, initLaf, getUIManager, setUIManager, isSurface, add, addAll, add, add, add, add, add, getLeadComponent, setLeadComponent, getLeadParent, keyPressed, keyReleased, getLayout, setLayout, invalidate, setShouldLayout, setShouldCalcPreferredSize, getLayoutWidth, getLayoutHeight, applyRTL, constrainWidthWhenScrollable, constrainHeightWhenScrollable, addComponent, addComponent, addComponent, addComponent, replaceAndWait, replaceAndWait, replace, replaceAndWait, replace, createReplaceTransition, isEnabled, setEnabled, removeComponent, cancelRepaints, flushReplace, removeAll, revalidateWithAnimationSafety, revalidate, revalidateLater, forceRevalidate, clearClientProperties, paint, paintGlass, layoutContainer, isSafeArea, setSafeArea, isSafeAreaRoot, getSafeAreaRoot, setSafeAreaRoot, getComponentCount, getComponentAt, getComponentIndex, contains, scrollComponentToVisible, getClosestComponentTo, getResponderAt, getComponentAt, findDropTargetAt, pointerPressed, calcPreferredSize, paramString, refreshTheme, isScrollableX, setScrollableX, isScrollableY, setScrollableY, getSideGap, getBottomGap, setScrollable, setCellRenderer, getScrollIncrement, setScrollIncrement, findFirstFocusable, dragInitiated, fireClicked, isSelectableInteraction, getGridPosY, paintComponentBackground, getGridPosX, animateHierarchyAndWait, createAnimateHierarchy, animateHierarchy, animateHierarchyFadeAndWait, createAnimateHierarchyFade, animateHierarchyFade, animateLayoutFadeAndWait, createAnimateLayoutFadeAndWait, animateLayoutFade, createAnimateLayoutFade, animateLayoutAndWait, animateLayout, updateTabIndices, createAnimateLayout, drop, createAnimateMotion, morph, morphAndWait, animateUnlayout, animateUnlayoutAndWait, createAnimateUnlayout, getChildrenAsList, iterator, iterator

From Component

setSameSize, isSetCursorSupported, parsePreferredSize, getDefaultDragTransparency, setDefaultDragTransparency, getEditingDelegate, setEditingDelegate, getCursor, setCursor, showNativeOverlay, hideNativeOverlay, updateNativeOverlay, getNativeOverlay, getAllStyles, getSameWidth, setSameWidth, getSameHeight, setSameHeight, getX, setX, getOuterX, getInnerX, getY, setY, getOuterY, getInnerY, isVisible, setVisible, getClientProperty, stripMarginAndPadding, putClientProperty, getDirtyRegion, setDirtyRegion, isOpaque, setOpaque, getWidth, setWidth, getOuterWidth, getInnerWidth, getHeight, setHeight, getOuterHeight, getInnerHeight, isDragRegion, getDragRegionStatus, getBaseline, getBaselineResizeBehavior, getPreferredSizeStr, setPreferredSizeStr, getPreferredSize, setPreferredSize, getScrollDimension, calcScrollSize, setScrollSize, getPreferredW, setPreferredW, getPreferredH, setPreferredH, getOuterPreferredH, getInnerPreferredH, getOuterPreferredW, getInnerPreferredW, setSize, getUIID, setUIID, setUIIDFinal, setUIID, getInlineAllStyles, setInlineAllStyles, getInlineSelectedStyles, setInlineSelectedStyles, getInlineUnselectedStyles, setInlineUnselectedStyles, getInlineDisabledStyles, setInlineDisabledStyles, getInlinePressedStyles, setInlinePressedStyles, remove, getParent, getOwner, setOwner, isOwnedBy, containsOrOwns, addFocusListener, removeFocusListener, addScrollListener, removeScrollListener, getSelectCommandText, setSelectCommandText, getLabelForComponent, setLabelForComponent, focusGained, focusLost, paintBackgrounds, paintShadows, getAbsoluteX, getAbsoluteY, isInClippingRegion, paintIntersectingComponentsAbove, paintScrollbars, paintScrollbarX, getScrollOpacity, getSelectedRect, paintScrollbarY, paintComponent, paintComponent, getBorder, getScrollable, paintBackground, isScrollable, getScrollX, setScrollX, getScrollY, setScrollY, onScrollX, onScrollY, getDraggedx, getDraggedy, contains, visibleBoundsContains, hasFixedPreferredSize, getBounds, getBounds, getVisibleBounds, getVisibleBounds, isFocusable, setFocusable, onSetFocusable, resetFocusable, getTabIndex, setTabIndex, getPreferredTabIndex, setPreferredTabIndex, isTraversable, setTraversable, handlesInput, setHandlesInput, consumesRawTextInput, hasFocus, setFocus, getComponentForm, getTopLevelContainer, repaint, repaint, longKeyPress, keyRepeated, registerForAnimation, deregisterFromAnimation, getAnimationManager, getScrollAnimationSpeed, setScrollAnimationSpeed, isBlockLead, setBlockLead, isIgnorePointerEvents, setIgnorePointerEvents, isRippleEffect, setRippleEffect, getInlineStylesTheme, setInlineStylesTheme, shouldRenderComponentSelection, isHideInLandscape, setHideInLandscape, createStyleAnimation, isSmoothScrolling, setSmoothScrolling, pointerHover, stopScrollMomentum, pointerHoverReleased, pointerHoverPressed, pinch, pinchReleased, pinch, rotation, isPinchBlocksDragAndDrop, setPinchBlocksDragAndDrop, pointerDragged, getDragImage, getDragTransparency, setDragTransparency, toImage, drawDraggedImage, draggingOver, dragEnter, dragExit, addPullToRefresh, setPullToRefresh, respondsToPointerEvents, pointerDragged, isStickyDrag, pointerPressed, isDragAndDropOperation, pointerReleased, longPointerPress, pointerReleased, setVerticalScrollBounds, setHorizontalScrollBounds, isVScrollThumbGrabbed, isHScrollThumbGrabbed, isVScrollThumbHover, isHScrollThumbHover, isTensileDragEnabled, setTensileDragEnabled, getTextSelectionSupport, addDropListener, removeDropListener, addDragOverListener, removeDragOverListener, isNativeDragSource, setNativeDragSource, getNativeDragOperation, setNativeDragOperation, createNativeDragOperation, isNativeDropTarget, setNativeDropTarget, getAcceptedDropMimeTypes, setAcceptedDropMimeTypes, getAcceptedDropActions, setAcceptedDropActions, canAcceptNativeDrop, nativeDragEnter, nativeDragOver, nativeDragExit, nativeDrop, addNativeDropListener, removeNativeDropListener, addNativeDragOverListener, removeNativeDragOverListener, dragFinished, addDragFinishedListener, addStateChangeListener, removeStateChangeListener, addPointerPressedListener, addLongPressListener, addContextMenuListener, removeContextMenuListener, addMouseWheelListener, removeMouseWheelListener, addStylusListener, removeStylusListener, mouseWheel, paintRippleOverlay, removePointerPressedListener, removeLongPressListener, removeDragFinishedListener, addPointerReleasedListener, removePointerReleasedListener, addPointerDraggedListener, removePointerDraggedListener, getDragSpeed, getStyle, getPressedStyle, setPressedStyle, initUnselectedStyle, initPressedStyle, initDisabledStyle, initSelectedStyle, getUnselectedStyle, setUnselectedStyle, getSelectedStyle, setSelectedStyle, getDisabledStyle, setDisabledStyle, installDefaultPainter, requestFocus, toString, refreshTheme, refreshTheme, isDragActivated, animate, scrollRectToVisible, scrollRectToVisible, paintBorder, paintBorderBackground, isCellRenderer, isScrollVisible, setScrollVisible, setIsScrollVisible, startEditingAsync, stopEditing, isEditing, isEditable, laidOut, deinitialize, initComponent, isInitialized, setInitialized, styleChanged, getNextFocusDown, setNextFocusDown, getNextFocusUp, setNextFocusUp, getNextFocusLeft, setNextFocusLeft, getNextFocusRight, setNextFocusRight, getName, setName, initCustomStyle, deinitializeCustomStyle, isRTL, setRTL, isTactileTouch, isTactileTouch, setTactileTouch, getPropertyNames, getPropertyTypes, getPropertyTypeNames, getPropertyValue, setPropertyValue, paintLockRelease, paintLock, isSnapToGrid, setSnapToGrid, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, blocksSideSwipe, isFlatten, setFlatten, getTensileLength, setTensileLength, isGrabsPointerEvents, setGrabsPointerEvents, getScrollOpacityChangeSpeed, setScrollOpacityChangeSpeed, growShrink, isAlwaysTensile, setAlwaysTensile, isDraggable, setDraggable, isDropTarget, setDropTarget, isChildOf, isHideInPortrait, setHideInPortrait, getBindablePropertyNames, getBindablePropertyTypes, bindProperty, unbindProperty, getBoundPropertyValue, setBoundPropertyValue, getCloudBoundProperty, setCloudBoundProperty, getCloudDestinationProperty, setCloudDestinationProperty, getComponentState, setComponentState, setHidden, isHidden, setHidden, isHidden, announceForAccessibility, getAccessibilityText, setAccessibilityText, getSemantics, getAccessibilityNode, accessibilityChanged, accessibilityChanged, getTooltip, setTooltip

Constructor details

Calendar

public Calendar(long time)
Creates a new instance of Calendar set to the given date based on time since epoch (the Date convention)

Parameters

time long
time since epoch

Calendar

public Calendar()
Constructs a calendar with the current date and time

Calendar

public Calendar(long time, TimeZone tmz)
Creates a new instance of Calendar set to the given date based on time since epoch (the Date convention)

Parameters

time long
time since epoch
tmz TimeZone
a reference timezone

Calendar

public Calendar(Image leftArrowImage, Image rightArrowImage)
Constructs a calendar with the current date and time with left and right images set

Parameters

leftArrowImage Image
an image for calendar left arrow
rightArrowImage Image
an image for calendar right arrow

Calendar

public Calendar(long time, TimeZone tmz, Image leftArrowImage, Image rightArrowImage)
Creates a new instance of Calendar set to the given date based on time since epoch (the Date convention)

Parameters

time long
time since epoch
tmz TimeZone
a reference timezone
leftArrowImage Image
an image for calendar left arrow
rightArrowImage Image
an image for calendar right arrow

Method details

getSelectedDay

public long getSelectedDay()
Returns the time for the current calendar.

Returns

the time for the current calendar.

getDate

public Date getDate()
Return the date object matching the current selection

Returns

the date object matching the current selection

setDate

public void setDate(Date d)
Sets the current date in the view and the selected date to be the same.

Parameters

d Date
new date

setYearRange

public void setYearRange(int minYear, int maxYear)
Sets the Calendar min and max years

Parameters

minYear int
the min year
maxYear int
the max year

setSelectedDate

public void setSelectedDate(Date d)
This method sets the Calendar selected day

Parameters

d Date
the selected day

getCurrentDate

public Date getCurrentDate()
Returns the currently viewed date (as opposed to the selected date)

Returns

the currently viewed date

setCurrentDate

public void setCurrentDate(Date d)
Sets the Calendar view on the given date, only the the month and year are being considered.

Parameters

d Date
the date to set the calendar view on.

getTimeZone

public TimeZone getTimeZone()
Gets the Calendar timezone

Returns

Calendar TimeZone

setTimeZone

public void setTimeZone(TimeZone tmz)
Sets the Calendar timezone, if not specified Calendar will use the default timezone

Parameters

tmz TimeZone
the timezone

getMonthViewSelectedStyle

public Style getMonthViewSelectedStyle()
Gets the selected style of the month view component within the calendar

Returns

the style of the month view

setMonthViewSelectedStyle

public void setMonthViewSelectedStyle(Style s)
Sets the selected style of the month view component within the calendar

Parameters

s Style
style for the month view

getMonthViewUnSelectedStyle

public Style getMonthViewUnSelectedStyle()
Gets the un selected style of the month view component within the calendar

Returns

the style of the month view

setMonthViewUnSelectedStyle

public void setMonthViewUnSelectedStyle(Style s)
Sets the un selected style of the month view component within the calendar

Parameters

s Style
style for the month view

addActionListener

public void addActionListener(ActionListener l)
Fires when a change is made to the month view of this component

Parameters

l ActionListener
listener to add

removeActionListener

public void removeActionListener(ActionListener l)
Fires when a change is made to the month view of this component

Parameters

l ActionListener
listener to remove

addMonthChangedListener

public void addMonthChangedListener(ActionListener l)
Fires when a new month is selected

Parameters

l ActionListener
listener to add

removeMonthChangedListener

public void removeMonthChangedListener(ActionListener l)
Fires when a new month is selected

Parameters

l ActionListener
listener to remove

addDayActionListener

public void addDayActionListener(ActionListener l)
Adds an ActionListener to the day buttons. This is different from Calendar.addActionListener and will only fire when an active day is selected.

Parameters

l ActionListener
listener to add

removeDayActionListener

public void removeDayActionListener(ActionListener l)
Removes ActionListener from day buttons

Parameters

l ActionListener
listener to remove

addDataChangedListener

public void addDataChangedListener(DataChangedListener l)
Allows tracking selection changes in the calendar in real time

Parameters

l DataChangedListener
listener to add

removeDataChangedListener

public void removeDataChangedListener(DataChangedListener l)
Allows tracking selection changes in the calendar in real time

Parameters

l DataChangedListener
listener to remove

addDataChangeListener

public void addDataChangeListener(DataChangedListener l)
Deprecated. use #addDataChangedListener(DataChangedListener) instead
Allows tracking selection changes in the calendar in real time

Parameters

l DataChangedListener
listener to add

removeDataChangeListener

public void removeDataChangeListener(DataChangedListener l)
Deprecated. use #removeDataChangedListener(DataChangedListener) instead
Allows tracking selection changes in the calendar in real time

Parameters

l DataChangedListener
listener to remove

isChangesSelectedDateEnabled

public boolean isChangesSelectedDateEnabled()
This flag determines if selected date can be changed by selecting an alternative date

Returns

true if enabled

setChangesSelectedDateEnabled

public void setChangesSelectedDateEnabled(boolean changesSelectedDateEnabled)
This flag determines if selected date can be changed by selecting an alternative date

Parameters

changesSelectedDateEnabled boolean
if true pressing on a date will cause the selected date to be changed to the pressed one

createDay

protected Button createDay()
Deprecated. override createDayComponent() instead
This method creates the Day Button Component for the Month View

Returns

a Button that corresponds to the Days Components

createDayTitle

protected Label createDayTitle(int day)
This method creates the Day title Component for the Month View

Parameters

day int
the relevant day values are 0-6 where 0 is Sunday.

Returns

a Label that corresponds to the relevant Day

updateButtonDayDate

protected void updateButtonDayDate(Component dayButton, int year, int currentMonth, int day)
This method updates the Button day.

Parameters

dayButton Component
the button to be updated
year int
the current year
currentMonth int
the current month
day int
the new button day

updateButtonDayDate

protected void updateButtonDayDate(Component dayButton, int currentMonth, int day)
This method updates the Button day.

Parameters

dayButton Component
the button to be updated
currentMonth int
the current month
day int
the new button day

updateButtonDayDate

protected void updateButtonDayDate(Button dayButton, int year, int currentMonth, int day)
Deprecated. override the method that accepts a generic component
This method updates the Button day.

Parameters

dayButton Button
the button to be updated
year int
the current year
currentMonth int
the current month
day int
the new button day

updateButtonDayDate

protected void updateButtonDayDate(Button dayButton, int currentMonth, int day)
Deprecated. override the method that accepts a generic component
This method updates the Button day.

Parameters

dayButton Button
the button to be updated
currentMonth int
the current month
day int
the new button day

isTwoDigitMode

public boolean isTwoDigitMode()
When set to true days will be rendered as 2 digits with 0 preceding single digit days

Returns

the twoDigitMode

setTwoDigitMode

public void setTwoDigitMode(boolean twoDigitMode)
When set to true days will be rendered as 2 digits with 0 preceding single digit days

Parameters

twoDigitMode boolean
the twoDigitMode to set

getSelectedDays

public Collection<Date> getSelectedDays()
Gets the dates selected on the calendar or null if no date is selected

Returns

the selected days

setSelectedDays

public void setSelectedDays(Collection<Date> selectedDays)
Sets the dates to be selected on the calendar

Parameters

selectedDays Collection<Date>
the multipleDateSelection to set

setSelectedDays

public void setSelectedDays(Collection<Date> selectedDays, String uiid)
Sets the dates to be selected on the calendar with a custom uiid. To use default uiid “CalendarMultipleDay”, call this method without the “uiid parameter”

Parameters

selectedDays Collection<Date>
the multipleDateSelection to set
uiid String
a custom uiid to be used in the dates selected

getSelectedDaysUIID

public String getSelectedDaysUIID()

Returns

selectedDays uiid

setSelectedDaysUIID

public void setSelectedDaysUIID(String uiid)
Sets the selectedDays UIID to the given uiid. being considered.

Parameters

uiid String
the uiid to change to

highlightDate

public void highlightDate(Date date, String uiid)
Highlights a date on the calendar using the supplied uiid. (Selected dates uiid takes precedence over highlighted dates uiid)

Parameters

date Date
the date to be highlighted
uiid String
a custom uiid to be used in highlighting the date

highlightDates

public void highlightDates(Collection<Date> dates, String uiid)
Highlights dates on the calendar using the supplied uiid. (Selected dates uiid takes precedence over highlighted dates uiid)

Parameters

dates Collection<Date>
the dates to be highlighted
uiid String
a custom uiid to be used in highlighting the dates

unHighlightDates

public void unHighlightDates(Collection<Date> dates)
Un-highlights dates on the calendar by removing the highlighting uiid. (selectedDaysUIID uiid will be applied to any of the dates that are part of selectedDays)

Parameters

dates Collection<Date>
the dates to be un-highlighted

unHighlightDate

public void unHighlightDate(Date date)
Un-highlights dates on the calendar by removing the highlighting uiid. (selectedDaysUIID uiid will be applied to the date if it is part of selectedDays)

Parameters

date Date
the date to be un-highlighted

isMultipleSelectionEnabled

public boolean isMultipleSelectionEnabled()
If true multiple days can be selected on a calendar and “getSelectedDays()” will return the dates selected

Returns

the multipleSelectionEnabled

setMultipleSelectionEnabled

public void setMultipleSelectionEnabled(boolean multipleSelectionEnabled)
When set to true multiple days can be selected on a calendar and “getSelectedDays()” will return the dates selected

Parameters

multipleSelectionEnabled boolean
the multipleSelectionEnabled to set

createDayComponent

protected Component createDayComponent()
Creates a day within the Calendar, this method is protected allowing Calendar to be subclassed to replace the rendering logic of individual day buttons.

Returns

a button representing the day within the Calendar

bindDayListener

protected void bindDayListener(Component cmp, ActionListener l)
Since a day may be any component type, developers should override this method to add support for binding the click listener to the given component.

Parameters

cmp Component
day component returned by createDayComponent()
l ActionListener
listener interface

setDayText

protected void setDayText(Component cmp, String text)
Since a day may be any component type, developers should override this method to add support for setting the displayed string.

Parameters

cmp Component
day component returned by createDayComponent()
text String
the text set the component to

getDayText

protected String getDayText(Component cmp)
Since a day may be any component type, developers should override this method to add support for removing the click listener from the given component.

Parameters

cmp Component
day component returned by createDayComponent

Returns

the day text

setDayUIID

protected void setDayUIID(Component cmp, String uiid)
Since a day may be any component type, developers should override this method to add support for setting the right component’s UIID.

Parameters

cmp Component
day component returned by createDayComponent()
uiid String
the text set the component to

setDayEnabled

protected void setDayEnabled(Component cmp, boolean enable)
Since a day may be any component type, developers should override this method to add support for enabling or disabling the right component.

Parameters

cmp Component
day component returned by createDayComponent()
enable boolean
the text set the component to