JCalendar
JavaTM
Bean
Kai Tödter
Version 1.03
04/10/1999
Introduction
JCalendar is a JavaTM
bean for graphically choosing a date. JCalendar is composed of several other
JavaTM 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:
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. 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 change. The foreground of "today" is painted red. |
![]() |
![]() |
![]() ![]() ![]() |
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 Java Foundation Classes 1.1 (Swing) components, so you need to
have the JFC installed. These beans require the new package names, like javax.swing.
So you need at least JFC 1.1 to run the beans. 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 JDK 1.2 (Java 2).
Download
and Latest Version
You can download
The latest version of CalendarBean you find in the Java section of www.toedter.com.
Installation
The installation is very easy, just put CalendarBean.jar in your classpath.
You can test the beans by invoking "java CalendarBean.JCalendarDemo".
Then a little demonstration is displayed where you can choose dates and locales.
Windows NT/98 users can also run the demo with runnit.bat.
API
Documentation
The complete API documentation is generated with JavaDoc (JDK 1.2). If you browse
this docoment locally or from doom.mchp.siemens.de, the API documentation is
available with frames or without frames.
Demo
Applet
To run the JCalendar demonstration applet in your browser, you must have installed
the JavaTM Plug-in and the
latest version of the JFC
(with javax.swing packages). Click here to run the applet.
Version | Description |
1.0 | Initial Version |
1.01 | Now working with JDK 1.2 RC 1 |
1.02 | Formating bug in JDayChooser fixed |
1.03 | Bug in JMonthChooser fixed. Now selecting the first month will update the JDayChooser |
License
This software is totally free. If you like it, send me a mail, a piece of chocolate,
money ... If you find any errors or things you don't like, please contact Kai Tödter.
Awards
This bean won first prize in the beans contest of the International
Java Club.