org.jdesktop.swingx
Class JXDatePickerFormatter

java.lang.Object
  extended by javax.swing.JFormattedTextField.AbstractFormatter
      extended by 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

Constructor Summary
JXDatePickerFormatter()
           
JXDatePickerFormatter(DateFormat[] formats)
           
 
Method Summary
 DateFormat[] getFormats()
           
 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

JXDatePickerFormatter

public JXDatePickerFormatter()

JXDatePickerFormatter

public JXDatePickerFormatter(DateFormat[] formats)
Method Detail

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