com.toedter.calendar
Class JSpinnerDateEditor
JSpinner
com.toedter.calendar.JSpinnerDateEditor
- ChangeListener, FocusListener, IDateEditor
public class JSpinnerDateEditor
extends JSpinner
JSpinnerDateEditor is a date editor based on a JSpinner.
$LastChangedRevision: 100 $, $LastChangedDate: 2006-06-04 14:36:06 +0200 (So, 04 Jun 2006) $
dateFormatString
protected String dateFormatString
dateFormatter
protected SimpleDateFormat dateFormatter
JSpinnerDateEditor
public JSpinnerDateEditor()
focusGained
public void focusGained(FocusEvent e)
focusLost
public void focusLost(FocusEvent focusEvent)
getMaxSelectableDate
public Date getMaxSelectableDate()
Gets the minimum selectable date.
- getMaxSelectableDate in interface IDateEditor
- the minimum selectable date
getUiComponent
public JComponent getUiComponent()
Returns the UI component, e.g. the actual JTextField implementing the
editor.
- getUiComponent in interface IDateEditor
setDate
public void setDate(Date date)
Sets the date. This should be implemented as a bound property, firing the
"date" property.
- setDate in interface IDateEditor
setDate
public void setDate(Date date,
boolean updateModel)
setDateFormatString
public void setDateFormatString(String dateFormatString)
Sets the date format string, e.g. "MM/dd/yy". If the date format string
is null or invalid, the date format string will be set to the MEDIUM
Simple date format of the current locale.
- setDateFormatString in interface IDateEditor
dateFormatString
- the date format string
setEnabled
public void setEnabled(boolean b)
Enables and disabled the compoment. It also fixes the background bug
4991597 and sets the background explicitely to a
TextField.inactiveBackground.
- setEnabled in interface IDateEditor
setLocale
public void setLocale(Locale locale)
Sets the locale. Usually this should have impact on the current date
format string.
- setLocale in interface IDateEditor
locale
- the locale to set
setMaxSelectableDate
public void setMaxSelectableDate(Date max)
- setMaxSelectableDate in interface IDateEditor
com.toedter.calendar.IDateEditor.setMaxSelectableDate(java.util.Date)
setMinSelectableDate
public void setMinSelectableDate(Date min)
- setMinSelectableDate in interface IDateEditor
com.toedter.calendar.IDateEditor.setMinSelectableDate(java.util.Date)
setSelectableDateRange
public void setSelectableDateRange(Date min,
Date max)
- setSelectableDateRange in interface IDateEditor
com.toedter.calendar.IDateEditor.setSelectableDateRange(java.util.Date, java.util.Date)
stateChanged
public void stateChanged(ChangeEvent e)
javax.swing.event.ChangeListener.stateChanged(javax.swing.event.ChangeEvent)
Copyright B) 1999 - 2006 Kai Toedter.