Local Date Combo

LocalDateCombo is a Swing date picker for selecting a java.time.LocalDate from a drop-down MonthView.  As with MonthView, the no-arg constructor creates a LocalDateCombo set to the current date, with no upper or lower limits.  Additionally, this uses a default format corresponding to java.time.format.FormatStyle.MEDIUM

Continue reading

Temporal Spinners

JSpinner was designed to work with Dates, Lists or Numbers.  With the introduction of a new Date/Time API in Java 8, wouldn’t it be great to be able to create date or time spinners that use the new classes?  SpinnerTemporalModel and SpinnerTemporalEditor make that possible.

Continue reading

Swing and Java 8

Java 7 brought us JLayer (which I haven’t played with), Generics in JComboBox and JList, and a lonely collections-oriented JList#getSelectedValuesList().  Java 8, on the other hand, did not introduce any new Swing API.  However, enhanced language features can certainly make Swing code less verbose and more maintainable, and the new Date/Time API makes it easier than ever before to create interactive Swing components for date and/or time selection.

Continue reading

Month View

MonthView is a composite of a YearMonthSpinner and a tabular calendar display of the selected month.  The table can be navigated with the arrow keys, and the month can be changed by the mouse scroll wheel. Optionally, a link for setting the value to the current date can be displayed.  Clicking on a displayed date sets it as the selected value.

Continue reading