UI JCalendar
Summary:
JCalendar is a Java bean used for the graphical selection of dates in Java applications. It is bundled with other beans including JDayChooser, JMonthChooser, and JYearChooser to enable fast and simple selection of dates in almost any situation.
Where to Find It:
JCalendar source code can be found at the following URL JCalendar. JCalendar is free software and can be used and modified freely. All of the beans use JFC (Swing) Components so J2SE of the JDK 1.5 must be installed.
The Basics:
The JCalendar Suite is implemented like a normal run of the mill java object. JCalendar can be implemented as a container for the other beans in the JCalendar suite or each individual bean can be implemented separately. The JCalendar Api is extremely useful in providing documentation on the capabilities of the individual classes within the suite. The basic implementation of a full JCalendar includes creating a JCalendar object and assigning JCalendar suite beans to that JCalendar object.
Ex.
beans[1] = new JDateChooser();
beans[2] = new JDayChooser();
beans[3] = new JMonthChooser();
beans[4] = new JYearChooser();
beans[5] = new JSpinField();
The individual suite beans too have to be configured as well, as they too are objects. Once all objects in the suite have been initialized, listeners have to be assigned to each object,( if they JCalendar is not strictly a visual but also an interactive component of an application.) The appearance of all the objects can also be set by using methods found within the classes. The Api can be found Here.
Customization:
JCalendar is very customizable in appearance. Objects can be set visible and not visible via methods within their respective classes and colors of backgrounds and foregrounds are also set via methods. This makes customizing JCalendar extremely easy.
Best Practices:
In creating a JCalendar, the developer should keep in mind the size of the objects as smaller objects are more difficult for a user to manipulate (especially the individual dates within a month). Size properties are easily set with methods within their respective classes. Also be careful with color configurations as different platforms display the same colors slightly differently. This will affect the appearance of the JCalendar.
Things to Watch Out for When Including JCalendar:
The trickiest part of the JCalendar is the addition, implementation, and initialization of listeners. Because JCalendar has the potential for being a highly interactive tool, event handling is extremely important and can get tricky. It is best to use as many of the methods provided for the object in the handling of specific events. The use of a graphical development environment such as Visual J makes this task less painful than the traditional manual approach.
References:
Other Helpful Resources:
http://java.sun.com/j2se/1.3/docs/api/