org.jdesktop.swingx
Class JXDatePickerFormatter
java.lang.Object
javax.swing.JFormattedTextField.AbstractFormatter
org.jdesktop.swingx.JXDatePickerFormatter
- All Implemented Interfaces:
- Serializable
public class JXDatePickerFormatter
- extends JFormattedTextField.AbstractFormatter
Default formatter for the JXDatePicker component. This factory
creates and returns a formatter that can handle a variety of date
formats.
- See Also:
- Serialized Form
JXDatePickerFormatter
public JXDatePickerFormatter()
JXDatePickerFormatter
public JXDatePickerFormatter(DateFormat[] formats)
getFormats
public DateFormat[] getFormats()
stringToValue
public Object stringToValue(String text)
throws ParseException
- Parses
text
returning an arbitrary Object. Some
formatters may return null.
- Specified by:
stringToValue
in class JFormattedTextField.AbstractFormatter
- Parameters:
text
- String to convert
- Returns:
- Object representation of text
- Throws:
ParseException
- if there is an error in the conversion
valueToString
public String valueToString(Object value)
throws ParseException
- Returns the string value to display for
value
.
- Specified by:
valueToString
in class JFormattedTextField.AbstractFormatter
- Parameters:
value
- Value to convert
- Returns:
- String representation of value
- Throws:
ParseException
- if there is an error in the conversion