|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JSpinner com.jidesoft.spinner.DateSpinner
public class DateSpinner
DateSpinner
is a spinner that is specialized in displaying or editing a a date or time.
JSpinner.setValue(Object)
and pass in a Date. To get the Date, using JSpinner.getValue()
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JSpinner |
---|
JSpinner.AccessibleJSpinner, JSpinner.DateEditor, JSpinner.DefaultEditor, JSpinner.ListEditor, JSpinner.NumberEditor |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
DateFormat |
_format
|
DefaultFormatter |
_formatter
|
JSpinner.DateEditor |
_timeEditor
|
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 java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
DateSpinner()
Creates a date spinner using locale default as the format string. |
|
DateSpinner(String format)
Creates a date spinner using the specified format string. |
|
DateSpinner(String format,
Date date)
Creates a date spinner using the specified format string and an initial value. |
Method Summary | |
---|---|
protected JSpinner.DateEditor |
createDateEditor(String format)
Creates the DateEditor. |
protected void |
customizeSpinner()
Customizes the spinner. |
boolean |
getAllowsInvalid()
Returns whether or not the value being edited is allowed to be invalid for a length of time. |
boolean |
getCommitsOnValidEdit()
Returns when edits are published back to the JFormattedTextField . |
boolean |
getOverwriteMode()
Returns the behavior when inserting characters. |
TimeZone |
getTimeZone()
Gets the time zone. |
boolean |
isLenient()
Tell whether date/time parsing is to be lenient. |
void |
setAllowsInvalid(boolean allowsInvalid)
Sets whether or not the value being edited is allowed to be invalid for a length of time (that is, stringToValue throws a ParseException ). |
void |
setCommitsOnValidEdit(boolean commit)
Sets when edits are published back to the JFormattedTextField . |
void |
setFormat(String format)
Sets the date format string used by this DateSpinner. |
void |
setLenient(boolean lenient)
Specify whether or not date/time parsing is to be lenient. |
void |
setOverwriteMode(boolean overwriteMode)
Configures the behavior when inserting characters. |
void |
setTimeZone(TimeZone zone)
Sets the time zone for the calendar of this DateFormat object. |
Methods inherited from class javax.swing.JSpinner |
---|
addChangeListener, commitEdit, createEditor, fireStateChanged, getAccessibleContext, getChangeListeners, getEditor, getModel, getNextValue, getPreviousValue, getUI, getUIClassID, getValue, removeChangeListener, setEditor, setModel, setUI, setValue, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public DefaultFormatter _formatter
public JSpinner.DateEditor _timeEditor
public DateFormat _format
Constructor Detail |
---|
public DateSpinner()
public DateSpinner(String format)
format
- the format string as defined in SimpleDateFormat
.public DateSpinner(String format, Date date)
format
- the format string as defined in SimpleDateFormat
.date
- initial valueMethod Detail |
---|
public void setFormat(String format)
format
- the formatprotected void customizeSpinner()
protected JSpinner.DateEditor createDateEditor(String format)
format
- the format
public void setCommitsOnValidEdit(boolean commit)
JFormattedTextField
. If true, commitEdit
is
invoked after every valid edit (any time the text is edited). On the other hand, if this is false than the
DefaultFormatter
does not publish edits back to the JFormattedTextField
. As such, the
only time the value of the JFormattedTextField
will change is when commitEdit
is
invoked on JFormattedTextField
, typically when enter is pressed or focus leaves the
JFormattedTextField
.
commit
- Used to indicate when edits are committed back to the JTextComponentpublic boolean getCommitsOnValidEdit()
JFormattedTextField
.
public void setOverwriteMode(boolean overwriteMode)
overwriteMode
is true (the default), new
characters overwrite existing characters in the model.
overwriteMode
- Indicates if overwrite or overstrike mode is usedpublic boolean getOverwriteMode()
public void setAllowsInvalid(boolean allowsInvalid)
stringToValue
throws a ParseException
). It is often convenient to allow the user to
temporarily input an invalid value.
allowsInvalid
- Used to indicate if the edited value must always be validpublic boolean getAllowsInvalid()
public void setTimeZone(TimeZone zone)
zone
- the given new time zone.public TimeZone getTimeZone()
public void setLenient(boolean lenient)
lenient
- when true, parsing is lenientCalendar.setLenient(boolean)
public boolean isLenient()
DateFormat.isLenient()
.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |