Posted by Darryl Burke on April 2, 2015
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.
The no-arg constructor creates a MonthView set to the current date, with no upper or lower bounds, and without a link for the current date. Other constructors allow setting these values. Here’s a MonthView set to 7 April 2015 that prevents selection of any date after 20 April 2015:
This code created that MonthView, and the screenshot was captured on 3 April 2015.
new MonthView(LocalDate.of(2015, Month.APRIL, 7),
LocalDate.of(2015, Month.APRIL, 20),
Please note that you will need JDK8 to compile and use this class. You will also need YearMonthSpinner and related classes, published earlier.