JCalendar

© Kai Toedter 1999-2002
Version v@VERSION@
@MODIFIED@

Introduction
JCalendar is a Java date chooser bean for graphically picking a date. JCalendar is composed of several other Java beans, a JDayChooser, a JMonthChooser and a JYearChooser. All these beans have a locale property, provide several icons (Color 16x16, Color 32x32, Mono 16x16 and Mono 32x32) and their own locale property editor. So they can easily be used in GUI builders. The CalendarBean JAR file contains 6 beans (see below).

License
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation. If you like and use it, just let me know. If you find any errors or things you don't like, please contact Kai Toedter.

Installation

The installation is very easy, just put jcalendar.jar in your classpath. If you want to run the JCalendar demos (see below) or just use the great Kunststoff Look & Feel (by Incors), put also kunststoff.jar in your classpath. Both in the lib directory of the distribution.

Running the Demos

To run the JCalendar demo applet in your browser, you must have installed the Java Plug-in. Click here to run the applet. If you have the distribution installed locally on your computer, there's several ways to run the demos. To start the JCalendar demo Windows XP/2000/NT/98 users can just execute the runnit.bat batch file in the bin directory of the distribution. For all other operating systems, just put jcalendar.jar and kunststoff.jar (both in the lib directory of the distribution) in your classpath and start Java to execute the com.toedter.calendar.JCalendarDemo class.

Components
The following table shows a list of used components (all Java Beans). All the screen shots use the great Kunststoff Look and Feel (by Incors) which is packaged with the JCalendar bean.

Icon 16x16

Icon 32x32

Component

Description

JCalendar allows you to choose a year, a month and a day. Depending on the locale, the month names and the weekday names change. The foreground of "today" is painted red. JCalendar is composed of several other beans described below.

JYearChooser is a JSpinField (see below) that allows you to choose a year by either typing the year in or using the spin buttons to increase or decrease the value.

JMonthChooser is a JComboBox that allows you to choose a month by either using the combo box or the spin buttons. The language of the month names is defined by the locale property.

JDayChooser lets you choose a day by clicking on the day number. Depending on the locale, the weekday names and the first days of the week change. The foreground of "today" is painted red. For navigation you can use the cursor and tab keys.



JSpinField lets you choose a numeric value. Properties for minimum and maximum values are provided. The value can be typed in directly or increased and decreased by the spin buttons. If you have typed in an incorrect value, the foreground color changes to red. Correct values are displayed green. After pressing the enter key the value will be set and displayed black.

JLocaleChooser is a JComboBox that allows you to choose a locale. It can be used to test or set the locales of the beans above.


Requirements

All beans use JFC (Swing) components, so you need to have the J2SE installed. For more information and the latest release of the JFC take a look at http://www.javasoft.com/products/jfc/index.html. All beans also work with J2 SDK 1.3 and 1.4).

Download and Latest Version
You can download a zip file, containing all the sources, libs and documentation at www.toedter.com/download/jcalendar.zip (267 KB).

API Documentation
The complete API documentation is generated with JavaDoc. The API documentation is available with frames or without frames.

History

Version

Description

1.0

Initial Version

1.01

Now working with JDK 1.2 RC 1

1.02

Bug in JDayChooser fixed

1.03

Bug in JMonthChooser fixed. Now selecting the first month will update the JDayChooser

1.04

Bug in JDayChooser fixed. Now backgrounds in last row are OK

1.05

Small bug fixes in JSpinField (Thanks to David Greiman)

1.06

Now runs in JDK 1.4beta

1.1

Bug fixes and additions (Thanks to Thomas Schaefer, Jeff Ulmer and others)
GNU Lesser General Public License
Build with ant

1.1.1

Bugs in BeanInfo classes fixed (Thanks to Andreas Wollschlaeger)

1.1.2

Bug in focus handling fixed

1.1.3 Bug in JMonthChooser fixed. Now changing the locale will not change the choosen month


Awards

This bean won first prize in the beans contest of the International Java Club. JCalendar was rated top25% by JARS (, 856 out of 1000).