
[ Whats New in DatePickerBean Version 4.0 ]


Hi Friends,

Let me first take this oppurtunity to thank Java Developers around the world who have downloaded and are using this bean. Thanks for making this bean such a huge success (it has over 3,000 downloads from various sites).

DatePickerBean is now much improved with new features, some bug fixes and an addition to the user interface (ie. the DatePickerBean Calendar).


New Features:
======================

I have added 12 new methods to the bean to make things easier for you viz.

 VIMP
************
This is perhaps the most important change:

In the version 2.0 & less the DatePicker worked perfectly in a standalone application but it failed to work in browsers.

The problem was traced to be that of the DatePicker's inability to support multiple listeners in the browser environment. 

Hence a solution was provided with version 3.0.
A new method called inBrowser(boolean) was added. Using which had a limitation. 

When set to true DatePicker was able to work in the browser but was now able to support only a Single Listener at a time & AutoCalendarPosition was always ignored. 


Things were fine till it was found that although DatePicker (v 3.0) worked perfectly in Internet Explorer it has some problem with Netscape. It works perfectly with Netscape under Windows 2000/NT but not under Windows 98/ME.


But now all the above limitations are sorted out with the current version(4.0).

You can also have multiple listners even while using the DP in a browser.
So you now, no longer need to to use inBrowser() methods at all.

Although they are still persisted for backward compatibility. But internally now they do not perform any significant task.


*****************************
So now you can safely replace the old version with the new. You will require absolutely no changes to your existing codes.
*****************************

There is One more imp. suggestion
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**>> VIMP

If you are intending to use this bean in a Browser, I would recommened that you extract DatePicker.jar file. You will get a DatePickerBean folder. Place this folder under the same location where you have your class that is using this bean present.

eg.
myapp.class is using the DatePicker class & it is present under the directory c:\MYdir
ie. C:\MYdir\myapp.class

Then place the extracted DatePickerBean directory under c:\MYdir
ie. C:\MYdir\DatePickerBean\*.*

This is to be done in case a browser does'nt understand the archive parameter of the applet tag.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


''''''''''''''''''''''''''''''''''''

AutoCalendarPosition
--------------------
In the previous versions whenever you used DP in browser the AutoCalendarPosition setting was ignored and the calendar always appeared in the center wr.t 800x600 screen resolution. But from this version AutoCalendarPosition will not be ignored. 

true:- means the Calendar position will be decided automatically some where near the DatePicker 	giving it a drop down effect.
false:- means the calendar will be centered to the screen taking the screen resolution in consideration.


''''''''''''''''''''''''''''''''''''

-------> public void showCalendar()
-------> public void showCalendar(int xpos,int ypos)
-------> public int getCalendarHeight()
-------> public int getCalendarWidth()

You can use the first 2 methods to launch the DatePicker Calendar from your own component.
I have provided a demo showcal.java which will give you an idea on how to go about doing this.


''''''''''''''''''''''''''''''''''''

-------> public String getFormattedDate(); 

I have overloaded the method 
	java.lang.String getFormattedDate(java.util.GregorianCalendar dt, int dtformat);
 
as above. This method will return the current date in the current format of your datepicker object as String.

''''''''''''''''''''''''''''''''''''

-------> public void void setCalendarOwner(Frame f) 
-------> public void setCalendarOwner(Dialog dlg)
-------> public void setCalendar_Modal(boolean flag) // by defualt false
-------> public boolean getCalendar_Modal()

If you go through the JDK documentations you will notice that the Dialog class (not JDialog) takes an owner frame & a modal setting in its contructor. The DatePicker Calendar is a Dialog & 
it has its own intrenal frame by default and it is now modeless (not modal) by default.

As it has its own internal frame the problem faced is that whenever the datepicker calendar is active and you shift between applications and come back to the original app containing the datepicker the calendar is not highligted. It is still behind some other application.

So I have now provided setCalendarOwner() methods so that you can supply your own existing Frame/Dialog reference to it. Now if you shift between apps & come back the calendar is right in front of you as it now becomes the child of your frame. You minimize/maximize your app & the calendar will also act accordingly.

===================================
**>> VIMP
Please go through CalOwnerDemo.java to know the exact way of using these methods.
===================================

You can also specifiy the Modality of the Calendar by using setCalendar_Modal(boolean flag)

NOTE:
The DatePickerCalendar object is created as soon as the DatePicker object is created using a default frame. If you notice the Dialog class documentation, you can set the owner settings only in the constructor. So whenever you are using setCalendarOwner() methods the DatePickerCalendar object has to be recreated. 

Hence although you can use these method any number of times for an object, My advice is that you set the value only once as soon as you create the DatePicker object to save on the the above said overhead.

''''''''''''''''''''''''''''''''''''

-------> setCalendarMonthColor(Color color)
-------> Color getCalendarMonthColor()
-------> void setCalendarYearColor(Color color)
-------> Color getCalendarYearColor()

In the previous version you had a Single Method to Set the Colors of Day,Month & Year.
viz. setCalendarDaysColor(Color color)

But with this version setCalendarDaysColor method will set only the Days Color.
To set the Month & Year color use the above methods.


''''''''''''''''''''''''''''''''''''

-------> public void showDateRangeInCalendar(boolean flag)
-------> public void showTodayInCalendar(boolean flag)

-------> public boolean getShowDateRangeInCalendar()
-------> public boolean getShowTodayInCalendar()

These are 2 more new methods which will help you to show/hide TODAY & DATE RANGE in the Calendar as per your need. They also effect the Height of the Calendar.

I recommend that you keep both the setting as true. Lets take a scenerio:

Suppose the DP has min date as Jan 15 2000 and the user is currently viewing that month & tries to select jan 1-14 he/she wont be able to do that. Nothing will happen, the calendar won't respond and he/she may assume that there is some problem. Hence I feel that showing the Range can keep the user informed. But you may hide it if you feel otherwise.

Regarding hiding Today. The decision is upto you. I have now introduce a new feature for Today.

Keep reading...

''''''''''''''''''''''''''''''''''''


Addition to the UserInterface:
====================================
1.
***
Click on the Today part of the calendar and if today falls in the Date Range then the current date automatically comes In-View on the calendar (NOTE: its not selected. Its shown to the user but the user still have to click on the date to select it).

2.
***
The Calendar now has the Year Part editable. You can either select the year using the Up-Down button or Key-in the year using the keyboard.

Note: Only valid years will be accepted and showed beside the year textfield in the Year Label.
The Valid Years are MinDate Year  to MaxDate Year.

--> The size of the Calendar had to be increased by 25% to accomodate the new component.


By default this Editable-Year is Visible the foll new methods are provided 
to determine its visiblity..

-------> setEditableYearVisible(boolean flag)
-------> boolean getEditableYearVisible()

3.
***
Beside being able to key-in the year part, in this version I am also providing a facility by which you click on the Year-Label & you get a list of all the valid years through a popup.

To make the user aware of this feature, I have provided a MouseOver effect.
You can set the Mouse Over color for the Year by using the foll methods:

-------> setCalendarMouseOverYear_Color(Color color)
-------> Color getCalendarMouseOverYear_Color()



============================================================================================
N O T E :

As the DatePicker class extends Button you can use all the methods which apply to a Button
viz visible,enable,background,foreground,fonts,etc.
============================================================================================

====================================
Check out FAQs.txt for exiting tips.
====================================


These are the new changes to the datepicker.


I thank all the users of DatePickerBean for their valuable suggestions.


Thank You,
Pramod Jaiswal


