JCalendar
| Features
| User Interface
| Controls
| Screenschots
| Demo
| Downloads
| Future Plans

JCalendar is a Swing component for selecting a date.

Features

- Easy to configure
- Highly customizable. See properties.
- Attractive user interface

User Interface

JCalendar has a nice and easy to use interface.

1. button for selecting the previous year;
2. button for selecting the previous month;
3. label that displays the current month, clicking on it will display a popup menu from which you can select a month;
4. label that displays the current year, clicking on it will display a popup menu from which you can select a year between `(x - minYearAmount, x + maxYearAmount)`, where `x = updateYearsOnChange ? currentYear : initialYear`;
5. button for selecting the next month;
6. button for selecting the next year;
7. header containing the week day labels; clicking on a weekday will change that day to become the first day of the week in the user interface if `changingFirstDayOfWeekAllowed` property is set;
8. cell containing a date;
9. cell containing a selected date;
10. grid lines; can be vertical or horizontal and are displayed if property `showHorizontalLines/showVerticalLines` is set.

Controls

The items 1-6 from user interface are the controls for JCalendar and they are located in the control area. The controls are shown only if the property `showControls` is set. The control area can be positioned above or under the calendar according to the value of the `controlsPosition` property.

Screenshots

Metal look'n'feel | Windows look'n'feel | Metouia look'n'feel
Different background and foreground colors for weekend days header, week days header, weekend days, week days, odd and even weeks, controls, grid lines | Notice the tooltips for the calendar cells | Espanol language and short display for weekday names in header
Controls area positioned under the calendar | No controls displayed | First day of the week is Wednesday

Demo

The JCalendar distribution includes a demo application with which you can configure this component. The demo application will preview the component and generate the Java code for configuration.

The demo application has four panels

Calendar | The preview component
Configuration | A panel containing controls for changing the preview component properties
Sample code | Text component containing the Java code that generates the component in the preview panel
Output | Text component to display output like selected dates in the preview component

You can run this demo from distribution (`java -jar jcalendar.jar`) or see the web-start demo.

Below you have screenshots of the demo application

Click on the images to see a larger version

Properties

The JCalendar component has the following properties:

Property | Description | Programatically | UI
--- | --- | --- | ---
month | The month for this calendar. |  |
year | The year for this calendar. |  |
dateFormatSymbols | The symbols used to display months and weekdays |  |
showControls | If the user controls are shown in the UI |  |
controlsPosition | The position of user controls. The possible values are `JCalendar.TOP` and `JCalendar.BOTTOM` for showing the controls above and under the calendar. |  |
controlsStep | The amount with which the year/month is increased/decreased. if the controls contains buttons for big steps. |  |
weekDayDisplayType | How the week days are displayed in the column header.

- `JCalendar.ONE` for the first letter of the week day name
- `JCalendar.SHORT` for the short name of the week day name
- `JCalendar.SHORT` for the long name of the week day name

showHorizontalLines | If the horizontal grid lines are shown in the calendar. |  |
showVerticalLines | If the vertical grid lines are shown in the calendar. |  |
selectionMode | The selection mode that can be single selection, continuous interval or multiple intervals. |  |
changingFirstDayOfWeekAllowed | If the user can change the first day of week by clicking on the corresponding column header. |  |
showCellTooltips | If the tooltips over the calendar days are shown. |  |
selectionMode | The selection mode that can be single selection, continuous interval or multiple intervals. |  |
tooltipDateFormat | The selection mode that can be single selection, continuous interval or multiple intervals. |  |

Every time a property is changed (programatically or from the user interface) a `java.beans.PropertyChangeEvent` is generated with the corresponding property name, old value and new value.

Download

You can download the binaries, sources or just the jar.

Future Plans

The future of JCalendar is based on your feedback, so send us your comments, improvement ideas and defect reports at users@jcalendar.dev.java.net