public class DatePickerFormatter extends JFormattedTextField.AbstractFormatter
Modifier and Type | Class and Description |
---|---|
static class |
DatePickerFormatter.DatePickerFormatterUIResource
Same as DatePickerFormatter, but tagged as UIResource.
|
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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) |
String |
valueToString(Object value) |
clone, getActions, getDocumentFilter, getFormattedTextField, getNavigationFilter, install, invalidEdit, setEditValid, uninstall
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
- public DateFormat[] getFormats()
public Object stringToValue(String text) throws ParseException
stringToValue
in class JFormattedTextField.AbstractFormatter
ParseException
public String valueToString(Object value) throws ParseException
valueToString
in class JFormattedTextField.AbstractFormatter
ParseException
protected DateFormat[] createDefaultFormats(Locale locale)
Copyright © 2016. All rights reserved.