|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.JFormattedTextField.AbstractFormatter
org.jdesktop.swingx.calendar.DatePickerFormatter
public class DatePickerFormatter
Default formatter for the JXDatePicker component. It can handle a variety of date formats.
| Nested Class Summary | |
|---|---|
static class |
DatePickerFormatter.DatePickerFormatterUIResource
Same as DatePickerFormatter, but tagged as UIResource. |
| Constructor Summary | |
|---|---|
DatePickerFormatter()
Instantiates a formatter with the localized format patterns defined in the swingx.properties. |
|
DatePickerFormatter(DateFormat[] formats)
Instantiates a formatter with the given date formats. |
|
DatePickerFormatter(DateFormat[] formats,
Locale locale)
Instantiates a formatter with the given formats and locale. |
|
DatePickerFormatter(Locale locale)
Instantiates a formatter with default date formats in the given locale. |
|
| Method Summary | |
|---|---|
protected DateFormat[] |
createDefaultFormats(Locale locale)
Creates and returns the localized default formats. |
DateFormat[] |
getFormats()
Returns an array of the formats used by this formatter. |
Object |
stringToValue(String text)
Parses text returning an arbitrary Object. |
String |
valueToString(Object value)
Returns the string value to display for value. |
| Methods inherited from class javax.swing.JFormattedTextField.AbstractFormatter |
|---|
clone, getActions, getDocumentFilter, getFormattedTextField, getNavigationFilter, install, invalidEdit, setEditValid, uninstall |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DatePickerFormatter()
public DatePickerFormatter(DateFormat[] formats)
formats - the array of formats to use. May be null to
use defaults or empty to do nothing (?), but must not contain
null formats.public DatePickerFormatter(Locale locale)
locale - the Locale the use for the default formats.
public DatePickerFormatter(DateFormat[] formats,
Locale locale)
formats - locale - | Method Detail |
|---|
public DateFormat[] getFormats()
public Object stringToValue(String text)
throws ParseException
text returning an arbitrary Object. Some
formatters may return null.
stringToValue in class JFormattedTextField.AbstractFormattertext - String to convert
ParseException - if there is an error in the conversion
public String valueToString(Object value)
throws ParseException
value.
valueToString in class JFormattedTextField.AbstractFormattervalue - Value to convert
ParseException - if there is an error in the conversionprotected DateFormat[] createDefaultFormats(Locale locale)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||