Class CalendarPanel

  • All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, Accessible

    public final class CalendarPanel
    extends JPanel
    A panel presenting a calendar for date/time selection.

    For a CalendarPanel without time fields use the dateCalendarPanel() factory method.
    For a CalendarPanel with time fields use the dateTimeCalendarPanel() factory method.

    Keyboard navigation:

    Previous/next year: CTRL + left/right arrow or down/up arrow.
    Previous/next month: SHIFT + left/right arrow or down/up arrow.
    Previous/next week: ALT + up/down arrow.
    Previous/next day: ALT + left/right arrow.
    Previous/next hour: SHIFT-ALT + left/right arrow or down/up arrow.
    Previous/next minute: CTRL-ALT + left/right arrow or down/up arrow.
    See Also:
    Serialized Form
    • Method Detail

      • setDate

        public void setDate​(LocalDate date)
        Sets the date to present in this calendar
        Parameters:
        date - the date to set
      • getDate

        public LocalDate getDate()
        Returns:
        the date currently displayed in this calendar
      • setDateTime

        public void setDateTime​(LocalDateTime dateTime)
        Sets the date/time to present in this calendar.
        Parameters:
        dateTime - the date/time to set
      • getDateTime

        public LocalDateTime getDateTime()
        Returns:
        the date/time currently displayed in this calendar
      • requestCurrentDayButtonFocus

        public void requestCurrentDayButtonFocus()
        Requests input focus for the current day button
      • addDateListener

        public void addDateListener​(EventDataListener<LocalDate> listener)
        Parameters:
        listener - a listener notified each time the date changes
      • addDateTimeListener

        public void addDateTimeListener​(EventDataListener<LocalDateTime> listener)
        Parameters:
        listener - a listener notified each time the date or time changes
      • removeDateListener

        public void removeDateListener​(EventDataListener<LocalDate> listener)
        Parameters:
        listener - the listener to remove
      • removeDateTimeListener

        public void removeDateTimeListener​(EventDataListener<LocalDateTime> listener)
        Parameters:
        listener - the listener to remove