public static class javax.swing
JSpinner.NumberEditor


Show All Login
Java SE 6
  
Extends: Component > Container > JComponent > JPanel > JSpinner.DefaultEditor
Contained within: JSpinner
Details
An editor for a JSpinner whose model is a SpinnerNumberModel. The value of the editor is displayed with a JFormattedTextField whose format is defined by a NumberFormatter instance whose minimum and maximum properties are mapped to the SpinnerNumberModel.
since1.4

Constructors
public JSpinner.NumberEditor(JSpinner spinner) Details
Construct a JSpinner editor that supports displaying and editing the value of a SpinnerNumberModel with a JFormattedTextField. This NumberEditor becomes both a ChangeListener on the spinner and a PropertyChangeListener on the new JFormattedTextField.
spinnerthe spinner whose model this editor will monitor
ThrowsIllegalArgumentException: if the spinners model is not an instance of SpinnerNumberModel
See also getModel, getFormat, javax.swing.SpinnerNumberModel
public JSpinner.NumberEditor(JSpinner spinner, String decimalFormatPattern) Details
Construct a JSpinner editor that supports displaying and editing the value of a SpinnerNumberModel with a JFormattedTextField. This NumberEditor becomes both a ChangeListener on the spinner and a PropertyChangeListener on the new JFormattedTextField.
spinnerthe spinner whose model this editor will monitor
decimalFormatPatternthe initial pattern for the DecimalFormat object that's used to display and parse the value of the text field.
ThrowsIllegalArgumentException: if the spinners model is not an instance of SpinnerNumberModel or if decimalFormatPattern is not a legal argument to DecimalFormat
See also getTextField, javax.swing.SpinnerNumberModel, java.text.DecimalFormat

Properties
public DecimalFormat getFormat() Details
Returns the java.text.DecimalFormat object the JFormattedTextField uses to parse and format numbers.
returnthe value of getTextField().getFormatter().getFormat().
See also getTextField, java.text.DecimalFormat
public SpinnerNumberModel getModel() Details
Return our spinner ancestor's SpinnerNumberModel.
returngetSpinner().getModel()
See also getSpinner, getTextField