javax.swing
Class JSpinner.NumberEditorFormatter
java.lang.Object
javax.swing.JFormattedTextField.AbstractFormatter
javax.swing.text.DefaultFormatter
javax.swing.text.InternationalFormatter
javax.swing.text.NumberFormatter
javax.swing.JSpinner.NumberEditorFormatter
- All Implemented Interfaces:
- Cloneable, Serializable
- Enclosing class:
- JSpinner
- private static class JSpinner.NumberEditorFormatter
- extends NumberFormatter
This subclass of javax.swing.NumberFormatter maps the minimum/maximum
properties to a SpinnerNumberModel and initializes the valueClass
of the NumberFormatter to match the type of the initial models value.
model
private final SpinnerNumberModel model
JSpinner.NumberEditorFormatter
JSpinner.NumberEditorFormatter(SpinnerNumberModel model,
NumberFormat format)
setMinimum
public void setMinimum(Comparable min)
- Description copied from class:
InternationalFormatter
- Sets the minimum permissible value. If the
valueClass
has
not been specified, and minimum
is non null, the
valueClass
will be set to that of the class of
minimum
.
- Overrides:
setMinimum
in class InternationalFormatter
- Parameters:
min
- Minimum legal value that can be input- See Also:
DefaultFormatter.setValueClass(java.lang.Class)
getMinimum
public Comparable getMinimum()
- Description copied from class:
InternationalFormatter
- Returns the minimum permissible value.
- Overrides:
getMinimum
in class InternationalFormatter
- Returns:
- Minimum legal value that can be input
setMaximum
public void setMaximum(Comparable max)
- Description copied from class:
InternationalFormatter
- Sets the maximum permissible value. If the
valueClass
has
not been specified, and max
is non null, the
valueClass
will be set to that of the class of
max
.
- Overrides:
setMaximum
in class InternationalFormatter
- Parameters:
max
- Maximum legal value that can be input- See Also:
DefaultFormatter.setValueClass(java.lang.Class)
getMaximum
public Comparable getMaximum()
- Description copied from class:
InternationalFormatter
- Returns the maximum permissible value.
- Overrides:
getMaximum
in class InternationalFormatter
- Returns:
- Maximum legal value that can be input