org.jdesktop.swingx.text
Class StrictNumberFormatter
java.lang.Object
javax.swing.JFormattedTextField.AbstractFormatter
javax.swing.text.DefaultFormatter
javax.swing.text.InternationalFormatter
javax.swing.text.NumberFormatter
org.jdesktop.swingx.text.StrictNumberFormatter
- All Implemented Interfaces:
- Serializable, Cloneable
public class StrictNumberFormatter
- extends NumberFormatter
Experiment to work around Issue #1183-swingx: NumberEditorExt throws exception
on getCellValue. Remaining issue: no visual error feedback if the expected
number type exceeds its range.
- Author:
- Jeanette Winzenburg
- See Also:
- Serialized Form
StrictNumberFormatter
public StrictNumberFormatter(NumberFormat format)
- Parameters:
format
-
setValueClass
public void setValueClass(Class<?> valueClass)
-
Overridden to automatically set the minimum/maximum to the boundaries of
the Number type if it corresponds to a raw type, or null if not.
- Overrides:
setValueClass
in class DefaultFormatter
setMaximum
public void setMaximum(Comparable max)
- Overrides:
setMaximum
in class InternationalFormatter
setMinimum
public void setMinimum(Comparable minimum)
- Overrides:
setMinimum
in class InternationalFormatter
stringToValue
public Object stringToValue(String text)
throws ParseException
- Returns the
Object
representation of the
String
text
, may be null.
- Overrides:
stringToValue
in class InternationalFormatter
- Parameters:
text
- String
to convert
- Returns:
Object
representation of text
- Throws:
ParseException
- if there is an error in the conversion
Copyright © 2012. All Rights Reserved.