java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
is.codion.swing.common.ui.component.calendar.CalendarPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

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

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: up/down arrow.
  • Previous/next day: 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:
  • Method Details

    • setLocalDate

      public void setLocalDate(LocalDate date)
      Sets the date to present in this calendar
      Parameters:
      date - the date to set
    • getLocalDate

      public LocalDate getLocalDate()
      Returns:
      the date currently displayed in this calendar
    • setLocalDateTime

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

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

      public void requestInputFocus()
      Requests input focus for this calendar panel
    • localDateValue

      public ValueObserver<LocalDate> localDateValue()
      Returns:
      an observer notified each time the date changes
    • localDateTimeValue

      public ValueObserver<LocalDateTime> localDateTimeValue()
      Returns:
      an observer notified each time the date or time changes
    • builder

      public static CalendarPanel.Builder builder()
      Returns:
      a new CalendarPanel.Builder instance
    • supportedTypes

      public static Collection<Class<? extends Temporal>> supportedTypes()
      Returns:
      the temporal types supported by this calendar panel