Class DatePicker

  • All Implemented Interfaces:

    public class DatePicker
    extends Dialog<LocalDate>
    DatePicker is a dialog that displays a custom control that allows the selection of a LocalDate based on the selection of a given day and month in the initial monthly view, and a given year in a yearly view.

    Based on Material Design guidelines, views can be switched by clicking in the labels that define the year, the day and month. Inside each view, months can be navigated by swipe gestures from left to right or right to left, as well as by dragging them to the left or to the right. Years can be navigated by scrolling vertically

    Screenshot of DatePicker

    The final selected local date will be available in the Dialog result property. Dialog.showAndWait() method will return an Optional instance with this result.

    Here is a typical implementation:

     DatePicker datePicker = new DatePicker();

    Selected local date can be also accessed through the dateProperty() .

    See Also:
    TimePicker, Dialog