Module java.desktop

Class DefaultFormatter

java.lang.Object
javax.swing.JFormattedTextField.AbstractFormatter
javax.swing.text.DefaultFormatter
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
InternationalFormatter, MaskFormatter

public class DefaultFormatter extends JFormattedTextField.AbstractFormatter implements Cloneable, Serializable
DefaultFormatter formats arbitrary objects. Formatting is done by invoking the toString method. In order to convert the value back to a String, your class must provide a constructor that takes a String argument. If no single argument constructor that takes a String is found, the returned value will be the String passed into stringToValue.

Instances of DefaultFormatter can not be used in multiple instances of JFormattedTextField. To obtain a copy of an already configured DefaultFormatter, use the clone method.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package. Please see XMLEncoder.

Since:
1.4
See Also: