JDatePickerBean
Class JDatePicker

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.AbstractButton
                          |
                          +--javax.swing.JButton
                                |
                                +--JDatePickerBean.JDatePicker

public class JDatePicker
extends javax.swing.JButton

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static int dd_mm_yyyy
           
static int dd_mmm_yyyy
           
static int dd_mmmm_yyyy
           
static int LANG_ENGLISH
           
static int LANG_FINNISH
           
static int LANG_FRENCH
           
static int ldow_dd_mmm_yyyy
           
static int ldow_dd_mmmm_yyyy
           
static int ldow_mmm_dd_yyyy
           
static int ldow_mmmm_dd_yyyy
           
static int mm_dd_yyyy
           
static int mmm_dd_yyyy
           
static int mmmm_dd_yyyy
           
static int sdow_dd_mmm_yyyy
           
static int sdow_dd_mmmm_yyyy
           
static int sdow_mmm_dd_yyyy
          Default Date Format
static int sdow_mmmm_dd_yyyy
           
 
Fields inherited from class javax.swing.AbstractButton
BORDER_PAINTED_CHANGED_PROPERTY, CONTENT_AREA_FILLED_CHANGED_PROPERTY, DISABLED_ICON_CHANGED_PROPERTY, DISABLED_SELECTED_ICON_CHANGED_PROPERTY, FOCUS_PAINTED_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, MARGIN_CHANGED_PROPERTY, MNEMONIC_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, PRESSED_ICON_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
  Default Date is Today.
Default Min Date is 'Previous years 1st January' and
Default Max Date is 'Next years 31st December'

           
Constructor Summary
JDatePicker()
          
JDatePicker(java.sql.Date date)
           
JDatePicker(java.sql.Date date, java.sql.Date mindate, java.sql.Date maxdate)
           
JDatePicker(java.util.GregorianCalendar date)
           
JDatePicker(java.util.GregorianCalendar date, java.util.GregorianCalendar mindate, java.util.GregorianCalendar maxdate)
           
JDatePicker(int yyyy, int mm, int dd)
           
 
Method Summary
 int addJDatePickerListener(JDatePickerListener dpl)
           
 boolean autoResizeDPButton()
           
 void autoResizeDPButton(boolean flag)
           
static int CompareDates(java.util.GregorianCalendar date1, java.util.GregorianCalendar date2)
          Returns -1 if date1 < date2
Returns 0 if date1 = date2
Returns +1 if date1 > date2
This method ignores the Time Factor while comparing
static int CompareDates(int dy1, int dm1, int dd1, int dy2, int dm2, int dd2)
          Returns -1 if date1 < date2
Returns 0 if date1 = date2
Returns +1 if date1 > date2
This method ignores the Time Factor while comparing
 void enableDateSelection(boolean flag)
           
 java.awt.Color getArrowColor()
           
 boolean getAutoCalendarPosition()
           
 boolean getCalendar_Modal()
           
 java.awt.Color getCalendarArrowColor()
           
 java.awt.Color getCalendarBackground()
           
 java.awt.Color getCalendarDaysColor()
           
 int getCalendarHeight()
           
 java.awt.Color getCalendarMonthColor()
           
 java.awt.Color getCalendarMouseOverYear_Color()
           
 java.awt.Color getCalendarSelectionColor()
           
 java.lang.String getCalendarTitle()
           
 java.awt.Color getCalendarWeekdaysColor()
           
 int getCalendarWidth()
           
 java.awt.Color getCalendarYearColor()
           
 java.util.GregorianCalendar getDate()
          Returns the Currently Selected Date.
 int getDateFormat()
           
 java.lang.String getDateStr()
           
 JDatePicker getDateValues()
           
 int getDay()
           
 int getDayFrom(java.util.GregorianCalendar date)
           
static int getDaysBetween(java.util.GregorianCalendar date1, java.util.GregorianCalendar date2)
          This method returns the number of days between date1 & date2.
 int getDisplayLanguage()
           
 java.lang.String getDOW(java.util.GregorianCalendar date)
          Returns the Day Of Week in String Format for the given GregorianCalendar Object.
eg."Sunday".
 boolean getEditableYearVisible()
           
 java.lang.String getFormat()
           
 java.lang.String getFormattedDate()
           
 java.lang.String getFormattedDate(java.util.GregorianCalendar dt, int dtformat)
          Returns a Date in String Format for the given GregorianCalendar Object with the specified Date Format Constant.
String str=yourJDatePickerObj.getFormattedDate(new GregorianCalendar(),JDatePicker.dd_mm_yyyy);
str will contain "31/12/2000".
 java.util.GregorianCalendar getMaxDate()
           
 java.util.GregorianCalendar getMinDate()
           
 int getMonth()
           
 int getMonthFrom(java.util.GregorianCalendar date)
           
 java.lang.String getMonthStr(java.util.GregorianCalendar date)
          Returns the Month in String Format for the given GregorianCalendar Object.
eg."January".
static int getNumberOfDaysInYear(int year)
           
 boolean getShowDateRangeInCalendar()
           
 boolean getShowTodayInCalendar()
           
 int getYear()
           
 int getYearFrom(java.util.GregorianCalendar date)
           
 boolean inApplet()
           
 void inApplet(boolean flag)
          Use this method only if you are placing the JDatePicker Object in an Applet.
 boolean inBrowser()
           
 void inBrowser(boolean flag)
           
 void paint(java.awt.Graphics g)
           
 int removeJDatePickerListener(JDatePickerListener dpl)
           
 void setArrowColor(java.awt.Color color)
           
 void setAutoCalendarPosition(boolean flag)
          if flag is true then Calendar Window is automatically positioned w.r.t the JDatePicker.
if flag is false then Calendar Window is centered.
 void setCalendar_Modal(boolean flag)
           
 void setCalendarArrowColor(java.awt.Color color)
           
 void setCalendarBackground(java.awt.Color color)
           
 void setCalendarDaysColor(java.awt.Color color)
           
 void setCalendarMonthColor(java.awt.Color color)
           
 void setCalendarMouseOverYear_Color(java.awt.Color color)
           
 void setCalendarOwner(java.awt.Dialog dlg)
           
 void setCalendarOwner(java.awt.Frame f)
           
 void setCalendarSelectionColor(java.awt.Color color)
           
 void setCalendarTitle(java.lang.String title)
           
 void setCalendarWeekdaysColor(java.awt.Color color)
           
 void setCalendarYearColor(java.awt.Color color)
           
 void setDate(java.sql.Date date)
          Sets the Date Format to as specified in .
Use one of the above formats.
eg.
 void setDate(java.util.GregorianCalendar dt)
           
 void setDate(int yyyy, int mm, int dd)
           
 void setDateFormat(int dateformat)
          Sets the Date Format to as specified in .
Use one of the above formats.
eg.
 void setDateValues(int cury, int curm, int curd, int miny, int minm, int mind, int maxy, int maxm, int maxd)
          Please Do not use this method.
This method will be used by your IDE to Generate JAVA Code.

Use setDateValues(JDatePicker dp) instead.
This method Will be Deprecated in future versions.
 void setDateValues(JDatePicker dp)
          Sets the Date, Minimum Date and Maximum date of your JDatePicker Object with the specified JDatePicker Object's Date, MinDate and MaxDate respectively.
 boolean setDisplayLanguage(int lang)
           
 void setEditableYearVisible(boolean flag)
           
 void setFormat(java.lang.String dateformat)
          Please Do not use this method.
This method will be used by your IDE to Generate JAVA Code.

Use setFormat(int) instead.
This method Will be Deprecated in future versions.
 void setMaxDate(java.sql.Date date)
           
 void setMaxDate(java.util.GregorianCalendar dt)
           
 void setMaxDate(int yyyy, int mm, int dd)
           
 void setMinDate(java.sql.Date date)
           
 void setMinDate(java.util.GregorianCalendar dt)
           
 void setMinDate(int yyyy, int mm, int dd)
           
 void setShowDateRangeInCalendar(boolean flag)
           
 void setShowTodayInCalendar(boolean flag)
           
 void showCalendar()
           
 void showCalendar(int xpos, int ypos)
           
 void showDateRangeInCalendar(boolean flag)
           
 void showTodayInCalendar(boolean flag)
           
 java.lang.String toString()
          Returns current contents of you object as
Current Date :Thursday, April 19, 2001
Min Date :Wednesday, May 12, 1999
Max Date :Wednesday, April 21, 2010
 
Methods inherited from class javax.swing.JButton
getAccessibleContext, getUIClassID, isDefaultButton, isDefaultCapable, setDefaultCapable, updateUI
 
Methods inherited from class javax.swing.AbstractButton
addActionListener, addChangeListener, addItemListener, doClick, doClick, getActionCommand, getDisabledIcon, getDisabledSelectedIcon, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getLabel, getMargin, getMnemonic, getModel, getPressedIcon, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getSelectedObjects, getText, getUI, getVerticalAlignment, getVerticalTextPosition, isBorderPainted, isContentAreaFilled, isFocusPainted, isRolloverEnabled, isSelected, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setBorderPainted, setContentAreaFilled, setDisabledIcon, setDisabledSelectedIcon, setEnabled, setFocusPainted, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setLabel, setMargin, setMnemonic, setMnemonic, setModel, setPressedIcon, setRolloverEnabled, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setUI, setVerticalAlignment, setVerticalTextPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, setLayout, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dd_mm_yyyy

public static final int dd_mm_yyyy

mm_dd_yyyy

public static final int mm_dd_yyyy

dd_mmm_yyyy

public static final int dd_mmm_yyyy

dd_mmmm_yyyy

public static final int dd_mmmm_yyyy

mmm_dd_yyyy

public static final int mmm_dd_yyyy

mmmm_dd_yyyy

public static final int mmmm_dd_yyyy

ldow_dd_mmm_yyyy

public static final int ldow_dd_mmm_yyyy

ldow_dd_mmmm_yyyy

public static final int ldow_dd_mmmm_yyyy

ldow_mmm_dd_yyyy

public static final int ldow_mmm_dd_yyyy

ldow_mmmm_dd_yyyy

public static final int ldow_mmmm_dd_yyyy

sdow_dd_mmm_yyyy

public static final int sdow_dd_mmm_yyyy

sdow_dd_mmmm_yyyy

public static final int sdow_dd_mmmm_yyyy

sdow_mmm_dd_yyyy

public static final int sdow_mmm_dd_yyyy
Default Date Format

sdow_mmmm_dd_yyyy

public static final int sdow_mmmm_dd_yyyy

LANG_ENGLISH

public static final int LANG_ENGLISH

LANG_FRENCH

public static final int LANG_FRENCH

LANG_FINNISH

public static final int LANG_FINNISH
Constructor Detail

JDatePicker

public JDatePicker()
Default Date is Today.
Default Min Date is 'Previous years 1st January' and
Default Max Date is 'Next years 31st December'

           

JDatePicker

public JDatePicker(java.sql.Date date)
            throws JDatePickerException

JDatePicker

public JDatePicker(java.util.GregorianCalendar date)
            throws JDatePickerException

JDatePicker

public JDatePicker(int yyyy,
                   int mm,
                   int dd)
            throws JDatePickerException

JDatePicker

public JDatePicker(java.sql.Date date,
                   java.sql.Date mindate,
                   java.sql.Date maxdate)
            throws JDatePickerException

JDatePicker

public JDatePicker(java.util.GregorianCalendar date,
                   java.util.GregorianCalendar mindate,
                   java.util.GregorianCalendar maxdate)
            throws JDatePickerException
Method Detail

setDisplayLanguage

public boolean setDisplayLanguage(int lang)

getDisplayLanguage

public int getDisplayLanguage()

setCalendarOwner

public void setCalendarOwner(java.awt.Frame f)

setCalendarOwner

public void setCalendarOwner(java.awt.Dialog dlg)

setCalendar_Modal

public void setCalendar_Modal(boolean flag)

getCalendar_Modal

public boolean getCalendar_Modal()

enableDateSelection

public void enableDateSelection(boolean flag)

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class javax.swing.JComponent

addJDatePickerListener

public int addJDatePickerListener(JDatePickerListener dpl)

removeJDatePickerListener

public int removeJDatePickerListener(JDatePickerListener dpl)

inApplet

public void inApplet(boolean flag)
Use this method only if you are placing the JDatePicker Object in an Applet.

inApplet

public boolean inApplet()

inBrowser

public void inBrowser(boolean flag)

inBrowser

public boolean inBrowser()

showCalendar

public void showCalendar()

showCalendar

public void showCalendar(int xpos,
                         int ypos)

setEditableYearVisible

public void setEditableYearVisible(boolean flag)

getEditableYearVisible

public boolean getEditableYearVisible()

autoResizeDPButton

public void autoResizeDPButton(boolean flag)

autoResizeDPButton

public boolean autoResizeDPButton()

setCalendarTitle

public void setCalendarTitle(java.lang.String title)

getCalendarTitle

public java.lang.String getCalendarTitle()

getCalendarHeight

public int getCalendarHeight()

getCalendarWidth

public int getCalendarWidth()

showTodayInCalendar

public void showTodayInCalendar(boolean flag)

setShowTodayInCalendar

public void setShowTodayInCalendar(boolean flag)

getShowTodayInCalendar

public boolean getShowTodayInCalendar()

showDateRangeInCalendar

public void showDateRangeInCalendar(boolean flag)

setShowDateRangeInCalendar

public void setShowDateRangeInCalendar(boolean flag)

getShowDateRangeInCalendar

public boolean getShowDateRangeInCalendar()

setArrowColor

public void setArrowColor(java.awt.Color color)

getArrowColor

public java.awt.Color getArrowColor()

setCalendarBackground

public void setCalendarBackground(java.awt.Color color)

getCalendarBackground

public java.awt.Color getCalendarBackground()

setCalendarArrowColor

public void setCalendarArrowColor(java.awt.Color color)

getCalendarArrowColor

public java.awt.Color getCalendarArrowColor()

setCalendarWeekdaysColor

public void setCalendarWeekdaysColor(java.awt.Color color)

getCalendarWeekdaysColor

public java.awt.Color getCalendarWeekdaysColor()

setCalendarDaysColor

public void setCalendarDaysColor(java.awt.Color color)

getCalendarDaysColor

public java.awt.Color getCalendarDaysColor()

setCalendarMonthColor

public void setCalendarMonthColor(java.awt.Color color)

getCalendarMonthColor

public java.awt.Color getCalendarMonthColor()

setCalendarYearColor

public void setCalendarYearColor(java.awt.Color color)

getCalendarYearColor

public java.awt.Color getCalendarYearColor()

setCalendarMouseOverYear_Color

public void setCalendarMouseOverYear_Color(java.awt.Color color)

getCalendarMouseOverYear_Color

public java.awt.Color getCalendarMouseOverYear_Color()

setCalendarSelectionColor

public void setCalendarSelectionColor(java.awt.Color color)

getCalendarSelectionColor

public java.awt.Color getCalendarSelectionColor()

setDateFormat

public void setDateFormat(int dateformat)
Sets the Date Format to as specified in .
Use one of the above formats.
eg. yourJDatePickerObj.setDateFormat(JDatePicker.ldow_mmm_dd_yyyy);

setAutoCalendarPosition

public void setAutoCalendarPosition(boolean flag)
if flag is true then Calendar Window is automatically positioned w.r.t the JDatePicker.
if flag is false then Calendar Window is centered.

getAutoCalendarPosition

public boolean getAutoCalendarPosition()

getFormat

public java.lang.String getFormat()

setFormat

public void setFormat(java.lang.String dateformat)
Please Do not use this method.
This method will be used by your IDE to Generate JAVA Code.

Use setFormat(int) instead.
This method Will be Deprecated in future versions.

setDate

public void setDate(java.sql.Date date)
             throws JDatePickerException
Sets the Date Format to as specified in .
Use one of the above formats.
eg. yourJDatePickerObj.setFormat(JDatePicker.ldow_mmm_dd_yyyy);

setDate

public void setDate(java.util.GregorianCalendar dt)
             throws JDatePickerException

setDate

public void setDate(int yyyy,
                    int mm,
                    int dd)
             throws JDatePickerException

setMinDate

public void setMinDate(java.sql.Date date)
                throws GreaterThanMaxDateException

setMinDate

public void setMinDate(int yyyy,
                       int mm,
                       int dd)
                throws JDatePickerException

setMinDate

public void setMinDate(java.util.GregorianCalendar dt)
                throws GreaterThanMaxDateException

setMaxDate

public void setMaxDate(java.sql.Date date)
                throws LessThanMinDateException

setMaxDate

public void setMaxDate(int yyyy,
                       int mm,
                       int dd)
                throws JDatePickerException

setMaxDate

public void setMaxDate(java.util.GregorianCalendar dt)
                throws LessThanMinDateException

toString

public java.lang.String toString()
Returns current contents of you object as
Current Date :Thursday, April 19, 2001
Min Date :Wednesday, May 12, 1999
Max Date :Wednesday, April 21, 2010
Overrides:
toString in class java.awt.Component

getDateFormat

public int getDateFormat()

getDate

public java.util.GregorianCalendar getDate()
Returns the Currently Selected Date.

getDateStr

public java.lang.String getDateStr()

getYear

public int getYear()

getMonth

public int getMonth()

getDay

public int getDay()

getMinDate

public java.util.GregorianCalendar getMinDate()

getMaxDate

public java.util.GregorianCalendar getMaxDate()

getYearFrom

public int getYearFrom(java.util.GregorianCalendar date)

getMonthFrom

public int getMonthFrom(java.util.GregorianCalendar date)

getDayFrom

public int getDayFrom(java.util.GregorianCalendar date)

getMonthStr

public java.lang.String getMonthStr(java.util.GregorianCalendar date)
Returns the Month in String Format for the given GregorianCalendar Object.
eg."January".

getDOW

public java.lang.String getDOW(java.util.GregorianCalendar date)
Returns the Day Of Week in String Format for the given GregorianCalendar Object.
eg."Sunday".

getFormattedDate

public java.lang.String getFormattedDate(java.util.GregorianCalendar dt,
                                         int dtformat)
Returns a Date in String Format for the given GregorianCalendar Object with the specified Date Format Constant.
String str=yourJDatePickerObj.getFormattedDate(new GregorianCalendar(),JDatePicker.dd_mm_yyyy);
str will contain "31/12/2000".

getFormattedDate

public java.lang.String getFormattedDate()

setDateValues

public void setDateValues(JDatePicker dp)
Sets the Date, Minimum Date and Maximum date of your JDatePicker Object with the specified JDatePicker Object's Date, MinDate and MaxDate respectively.

setDateValues

public void setDateValues(int cury,
                          int curm,
                          int curd,
                          int miny,
                          int minm,
                          int mind,
                          int maxy,
                          int maxm,
                          int maxd)
Please Do not use this method.
This method will be used by your IDE to Generate JAVA Code.

Use setDateValues(JDatePicker dp) instead.
This method Will be Deprecated in future versions.

getDateValues

public JDatePicker getDateValues()

CompareDates

public static int CompareDates(java.util.GregorianCalendar date1,
                               java.util.GregorianCalendar date2)
Returns -1 if date1 < date2
Returns 0 if date1 = date2
Returns +1 if date1 > date2
This method ignores the Time Factor while comparing

CompareDates

public static int CompareDates(int dy1,
                               int dm1,
                               int dd1,
                               int dy2,
                               int dm2,
                               int dd2)
Returns -1 if date1 < date2
Returns 0 if date1 = date2
Returns +1 if date1 > date2
This method ignores the Time Factor while comparing

getDaysBetween

public static int getDaysBetween(java.util.GregorianCalendar date1,
                                 java.util.GregorianCalendar date2)
This method returns the number of days between date1 & date2. If you need difference in months divide the output by 12 and if you need the difference in years divide it by 365

getNumberOfDaysInYear

public static int getNumberOfDaysInYear(int year)