JDatePicker v4.3

com.standbysoft.component.date.swing
Class JDateEditComponent

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycom.standbysoft.component.date.swing.JDateComponent
                  extended bycom.standbysoft.component.date.swing.JDateEditComponent
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.swing.SwingConstants
Direct Known Subclasses:
JDateField, JDatePicker

public abstract class JDateEditComponent
extends JDateComponent
implements javax.swing.SwingConstants

JDateEditComponent is the base class for all date editing components. You can find task-oriented documentation and examples of using date edit components in Using a JDateEditComponent, a section in The JDatePicker Suite Tutorial.

By default, dates are edited using an internal editor that forces users to type correct dates according to a date format. Although there are a few ways to specify the date format, we recommend using either a string pattern or a DateFormat style.

The component can also accept free text entries that are converted to dates using a date parser. This makes it possible to plug special parsers that can convert shortcut strings like 'today' to an appropriate date. If you are using the structured date editor (freeText is false), then you can enable or disable the autoCentury property. If set to true, short years like 80 will be converted to long ones like 1980.

An important part of this component's API is reserved for date validation. You can test if a date is valid, execute your own action when the date is invalid and ask for a certain edit to be commited. For a date to be valid, it must be accepted by the date selection model. A date edit component can be configured to indicate what must happen at validation time. Such properties are:

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class com.standbysoft.component.date.swing.JDateComponent
JDateComponent.DateAction, JDateComponent.RollDateAction, JDateComponent.SelectFirstDayAction, JDateComponent.SelectLastDayAction, JDateComponent.SelectNoneAction, JDateComponent.SelectTodayAction
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean autoRestore
           
protected  boolean autoValidate
           
protected  boolean beepOnError
           
protected  java.text.DateFormat dateFormat
          The date format used by this component to display dates.
protected  java.lang.String dateFormatPattern
          The string pattern used to specify the date format.
protected  int dateFormatStyle
          The DateFormat style (SHORT, MEDIUM, LONG, FULL) used to specify the date format.
protected  DateModel dateModel
           
protected  DateListener dateModelListener
           
protected  DateParser dateParser
           
protected  java.lang.String emptySelectionText
           
protected  boolean freeText
           
protected  int horizontalAlignment
           
protected  java.lang.String text
           
protected  int timeFormatStyle
          The DateFormat style (SHORT, MEDIUM, LONG, FULL) used to specify the time format.
 
Fields inherited from class com.standbysoft.component.date.swing.JDateComponent
actionCommand, calendar, dateSelectionModel, dateSelectionModelListener, locale, selectFirstDayAction, selectLastDayAction, selectNextDayAction, selectNoneAction, selectPreviousDayAction, selectSameDayNextMonthAction, selectSameDayNextWeekAction, selectSameDayNextYearAction, selectSameDayPreviousMonthAction, selectSameDayPreviousWeekAction, selectSameDayPreviousYearAction, selectTodayAction, timeZone
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JDateEditComponent()
          Creates a default date field that has the today date selected.
JDateEditComponent(DateSelectionModel model)
           
 
Method Summary
 void addDateListener(DateListener listener)
          Registers a date listener that will receive notifications when the date model changes.
 void commitEdit()
          Makes the currently edited date to be the selected date but only if it is valid.
protected  void fireDateChanged(DateEvent evt)
           
protected  void fireDateFieldChanged(DateEvent evt)
           
protected  void fireDateFieldCleared(DateEvent evt)
           
 int getAutoCenturyYear()
          Detrmines the year used to build the long year when short years are used.
 java.text.DateFormat getDateFormat()
          Returns the format used to display and edit the selected date.
 DateModel getDateModel()
          Returns the date model used by this component.
 DateParser getDateParser()
          Determines the date parser that converts free text entries into dates.
 java.lang.String getEmptySelectionText()
          Returns the text displayed by this component when there is no date selected.
 int getHorizontalAlignment()
          Returns the horizontal alignment of the date.
 java.lang.String getSelectedDateAsText()
          Returns the selected date in text form.
 java.lang.String getText()
           
protected  void invalidEdit()
          Invoked on an invalid date input.
 boolean isAutoCentury()
          Determines whether century is automatically added to the year field if its value is less than 100.
 boolean isAutoRestore()
          Determines whether an invalid date should be automatically restored to the last valid date.
 boolean isAutoValidate()
          Determines whether the date edited by this component should be validated when focus is lost.
 boolean isBeepOnError()
          Determines whether a beep will sound if the typed date is not valid, at validation time.
 boolean isEditValid()
          Determines whether the current edited date is valid.
 boolean isFreeText()
          Determines whether free text date entries are allowed.
 void removeDateListener(DateListener listener)
          Removes a date listener registered on this component.
 void setAutoCentury(boolean enabled)
          Specifies whether century is automatically added to the year field if its value is less than 100.
 void setAutoCenturyYear(int year)
          Specifies the year used to build the long year when short years are used.
 void setAutoRestore(boolean enabled)
          Specifies whether an invalid date should be automatically restored to the last valid date.
 void setAutoValidate(boolean enabled)
          Specifies whether the temporary represented date is validated when the component loses focus.
 void setBeepOnError(boolean enabled)
          Specifies whether a beep will sound if the typed date is not valid, at validation time.
 void setDateFormat(java.text.DateFormat format)
          Specifies the format used to display and edit the date.
 void setDateFormat(int dateFormat)
          Specifies the date format by means of DateFormat predefined styles.
 void setDateFormat(int dateFormat, int timeFormat)
          Specifies a date format that includes time information by means of DateFormat predefined styles.
 void setDateFormat(java.lang.String pattern)
          Specifies the date format by means of programmer defined string patterns.
 void setDateModel(DateModel model)
          Specifies a new date model for this component.
 void setDateParser(DateParser parser)
          Specifies the date parser that will be used to convert free text entries into dates.
 void setDateSelectionModel(DateSelectionModel model)
          Specifies a new selection model for this component.
 void setEmptySelectionText(java.lang.String text)
          Specifies the text displayed by this component when there is no date selected.
 void setFreeText(boolean enabled)
          Specifies whether free text date entries are allowed.
 void setHorizontalAlignment(int alignment)
          Sets the horizontal alignment of the date.
 void setLocale(java.util.Locale locale)
          Overrides the parent locale method in order to update the date format, if possible.
 void setSelectedDate(java.util.Date date)
          Overridden to implement special behavior for a date edit component that cannot be implemented in the base class.
 void setText(java.lang.String text)
           
 void setTimeZone(java.util.TimeZone zone)
          Overriden in order to configure the internal date model to use the new time zone.
 
Methods inherited from class com.standbysoft.component.date.swing.JDateComponent
addActionListener, addDateSelectionListener, fireActionEvent, fireDateSelectionChanged, fireDisabledDatesChanged, fireDisabledDateSelectionAttempted, fireEmptySelectionAllowedChanged, fireSelectionModeChanged, getActionCommand, getCalendar, getDateSelectionModel, getLocale, getSelectedDate, getTimeZone, getUI, isEmptySelectionAllowed, removeActionListener, removeDateSelectionListener, setActionCommand, setEmptySelectionAllowed, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dateFormat

protected java.text.DateFormat dateFormat
The date format used by this component to display dates.


dateFormatStyle

protected int dateFormatStyle
The DateFormat style (SHORT, MEDIUM, LONG, FULL) used to specify the date format. When the date format is specified otherwise than using a style, this field is -1.

See Also:
setDateFormat(int, int)

timeFormatStyle

protected int timeFormatStyle
The DateFormat style (SHORT, MEDIUM, LONG, FULL) used to specify the time format. When the date format is specified otherwise than using a style, this field is -1.

See Also:
setDateFormat(int, int)

dateFormatPattern

protected java.lang.String dateFormatPattern
The string pattern used to specify the date format. When the date format is specified otherwise than using a pattern, this field is null.

See Also:
setDateFormat(String)

emptySelectionText

protected java.lang.String emptySelectionText

autoRestore

protected boolean autoRestore

autoValidate

protected boolean autoValidate

beepOnError

protected boolean beepOnError

dateModel

protected DateModel dateModel

dateModelListener

protected DateListener dateModelListener

dateParser

protected DateParser dateParser

freeText

protected boolean freeText

horizontalAlignment

protected int horizontalAlignment

text

protected java.lang.String text
Constructor Detail

JDateEditComponent

public JDateEditComponent()
Creates a default date field that has the today date selected. Null dates are allowed by default.


JDateEditComponent

public JDateEditComponent(DateSelectionModel model)
Method Detail

setSelectedDate

public void setSelectedDate(java.util.Date date)
Overridden to implement special behavior for a date edit component that cannot be implemented in the base class. If the edited date is not valid and we try to select a date, the selected date will replace the editor values. Especially if the date that will be selected is the same with the one already selected.

Overrides:
setSelectedDate in class JDateComponent
Parameters:
date - date to be selected

setDateModel

public void setDateModel(DateModel model)
Specifies a new date model for this component. The date model manages date field information.

Parameters:
model - new date model to be used by this component

getDateModel

public DateModel getDateModel()
Returns the date model used by this component.

Returns:
date model used by this component.
See Also:
setDateModel(DateModel)

addDateListener

public void addDateListener(DateListener listener)
Registers a date listener that will receive notifications when the date model changes.

Parameters:
listener - listener that is registered
See Also:
setDateModel(DateModel), removeDateListener(DateListener)

removeDateListener

public void removeDateListener(DateListener listener)
Removes a date listener registered on this component.

Parameters:
listener - listener that is removed

setAutoCentury

public void setAutoCentury(boolean enabled)
Specifies whether century is automatically added to the year field if its value is less than 100.

Parameters:
enabled - true if century is automatically added; false otherwise
See Also:
DateModel.setAutoCentury(boolean)

isAutoCentury

public boolean isAutoCentury()
Determines whether century is automatically added to the year field if its value is less than 100.

Returns:
true if century is automatically added; false otherwise.
See Also:
DateModel.isAutoCentury()

setAutoCenturyYear

public void setAutoCenturyYear(int year)
Specifies the year used to build the long year when short years are used.

Parameters:
year - year used to build the long year when short years are used
See Also:
DateModel.setAutoCenturyYear(int)

getAutoCenturyYear

public int getAutoCenturyYear()
Detrmines the year used to build the long year when short years are used.

Returns:
year used to build the long year when short years are used.
See Also:
DateModel.getAutoCenturyYear()

getEmptySelectionText

public java.lang.String getEmptySelectionText()
Returns the text displayed by this component when there is no date selected.

Returns:
the text displayed by this component when there is no date selected.
See Also:
setEmptySelectionText(String)

setEmptySelectionText

public void setEmptySelectionText(java.lang.String text)
Specifies the text displayed by this component when there is no date selected.

Parameters:
text - text displayed by this component when there is no date selected

getSelectedDateAsText

public java.lang.String getSelectedDateAsText()

Returns the selected date in text form. This text form is obtained by formatting the currently selected date using the current date format. If the date is null then the returned string is the null text.

This method is particularly useful if you need to return the text representation of the date as a custom string. For instance, you could override it to represent the Christmas date as Christmas '01 instead of Dec 25, 2001.

The text returned by this method is used to represent the dates in date edit components when the free text mode is enabled. It's sort of a renderer but only in text form.

Returns:
the selected date in text form
See Also:
getEmptySelectionText(), getDateFormat()

setDateSelectionModel

public void setDateSelectionModel(DateSelectionModel model)
Specifies a new selection model for this component. The selection model is modified to allow only single date selection.

Overrides:
setDateSelectionModel in class JDateComponent
Parameters:
model - new selection model to be used by this component

getDateFormat

public java.text.DateFormat getDateFormat()
Returns the format used to display and edit the selected date.

Returns:
the format used to display the selected date.
See Also:
setDateFormat(DateFormat)

setDateFormat

public void setDateFormat(java.text.DateFormat format)

Specifies the format used to display and edit the date. This is the most generic way of specifying the format. The API also contains two other methods that can specify the format as an int constant and as a string pattern.

Keep in mind that if the locale is changed for this component and you are using this method to specify the date format, you would have to change the date format too.

On the other hand, if you are using the other two methods to specify the date format, it will be updated automatically when the locale is changed.

Parameters:
format - actual date format
Throws:
java.lang.NullPointerException - if the given format is null
See Also:
setDateFormat(int), setDateFormat(String)

setDateFormat

public void setDateFormat(int dateFormat)
Specifies the date format by means of DateFormat predefined styles. The date format is built automatically using the specified style and the current locale. Actually, this is just a wrapper method that makes the date format setting easier.

Parameters:
dateFormat - format used to display the selected date. Valid values are DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG or DateFormat.FULL.
See Also:
setDateFormat(DateFormat), setDateFormat(String), setDateFormat(int, int)

setDateFormat

public void setDateFormat(int dateFormat,
                          int timeFormat)
Specifies a date format that includes time information by means of DateFormat predefined styles.

Parameters:
dateFormat - format used to display the date part of the date. Valid values are DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG or DateFormat.FULL.
timeFormat - format used to display the time part of the date. Valid values are DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG or DateFormat.FULL.
See Also:
setDateFormat(DateFormat), setDateFormat(String), setDateFormat(int)

setDateFormat

public void setDateFormat(java.lang.String pattern)

Specifies the date format by means of programmer defined string patterns. The date format is built automatically using the specified pattern and the current locale. Actually, this is just a wrapper method that makes the date format setting easier.

A complete description of the syntax used to define date format patterns can be found in the Java Tutorial. For instance if you want to format dates like "12:08 PM" you must use the string "h:mm a" as pattern.

Parameters:
pattern - new date pattern that will be used to format dates for display or editing
See Also:
setDateFormat(DateFormat), setDateFormat(int)

setLocale

public void setLocale(java.util.Locale locale)
Overrides the parent locale method in order to update the date format, if possible. If the date format is specified by its int pattern or the string pattern, then we can update it to the current locale.

Overrides:
setLocale in class JDateComponent
Parameters:
locale - creates a specific configuration for this component

setText

public void setText(java.lang.String text)

getText

public java.lang.String getText()

setDateParser

public void setDateParser(DateParser parser)
Specifies the date parser that will be used to convert free text entries into dates. The date parser is used only if free text is enabled.

Parameters:
parser - date parser that will be used to convert free text entries into dates
See Also:
setFreeText(boolean)

getDateParser

public DateParser getDateParser()
Determines the date parser that converts free text entries into dates.

Returns:
date parser that converts free text entries into dates.
See Also:
setDateParser(DateParser)

setFreeText

public void setFreeText(boolean enabled)
Specifies whether free text date entries are allowed. When free text entries are enabled, the current date parser will be used to parse the specified text to convert it into a date.

Parameters:
enabled - true if free text is enabled; false otherwise
See Also:
setDateParser(DateParser)

isFreeText

public boolean isFreeText()
Determines whether free text date entries are allowed.

Returns:
true if free text date entries are allowed; false otherwise.
See Also:
setFreeText(boolean)

setAutoValidate

public void setAutoValidate(boolean enabled)
Specifies whether the temporary represented date is validated when the component loses focus. If not validated, the represented date is not the same with that selected by this component.

Parameters:
enabled - true if validation should occur when focus is lost; false otherwise
See Also:
JDateComponent.getSelectedDate()

isAutoValidate

public boolean isAutoValidate()
Determines whether the date edited by this component should be validated when focus is lost.

Returns:
true if validation should occur when focus is lost; false otherwise.
See Also:
setAutoValidate(boolean)

setBeepOnError

public void setBeepOnError(boolean enabled)
Specifies whether a beep will sound if the typed date is not valid, at validation time.

Parameters:
enabled - true if the beep will sound on invalid entries; false otherwise
See Also:
invalidEdit()

isBeepOnError

public boolean isBeepOnError()
Determines whether a beep will sound if the typed date is not valid, at validation time.

Returns:
true if the beep will sound on invalid entries; false otherwise.
See Also:
setBeepOnError(boolean)

invalidEdit

protected void invalidEdit()
Invoked on an invalid date input. It beeps if beep on error is enabled. You can override this to implement your own handling scheme.

See Also:
setBeepOnError(boolean)

isEditValid

public boolean isEditValid()

Determines whether the current edited date is valid. A valid date is a date that can be selected by the date selection model.

Returns:
true if the date is accepted by the date selection model; false otherwise.
See Also:
DateSelectionModel.isDateSelectable(Date)

commitEdit

public void commitEdit()
Makes the currently edited date to be the selected date but only if it is valid.

See Also:
isEditValid()

setAutoRestore

public void setAutoRestore(boolean enabled)
Specifies whether an invalid date should be automatically restored to the last valid date.

Parameters:
enabled - true if at validation time, an invalid date should be automatically restored to the last valid date; false otherwise
See Also:
setAutoValidate(boolean)

isAutoRestore

public boolean isAutoRestore()
Determines whether an invalid date should be automatically restored to the last valid date.

Returns:
true if at validation time, an invalid date should be automatically restored to the last valid date; false otherwise.
See Also:
setAutoRestore(boolean)

setHorizontalAlignment

public void setHorizontalAlignment(int alignment)
Sets the horizontal alignment of the date.

Parameters:
alignment - how to align the date. Acceptable values are: JDateEditComponent.LEFT, JDateEditComponent.CENTER, JDateEditComponent.RIGHT, JDateEditComponent.LEADING (the default) or JDateEditComponent.TRAILING
Throws:
java.lang.IllegalArgumentException - if alignment is not a valid

getHorizontalAlignment

public int getHorizontalAlignment()
Returns the horizontal alignment of the date.

Returns:
the horizontal alignment
See Also:
setHorizontalAlignment(int)

setTimeZone

public void setTimeZone(java.util.TimeZone zone)
Overriden in order to configure the internal date model to use the new time zone.

Overrides:
setTimeZone in class JDateComponent
Parameters:
zone - new time zone for this component

fireDateFieldChanged

protected void fireDateFieldChanged(DateEvent evt)

fireDateFieldCleared

protected void fireDateFieldCleared(DateEvent evt)

fireDateChanged

protected void fireDateChanged(DateEvent evt)

JDatePicker v4.3

Visit www.jdatepicker.com for further information or send us your suggestions.

Copyright © 2003-2007 Stand By Soft Ltd. All Rights Reserved.