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
.
spinner | the spinner whose model this editor will monitor | |
decimalFormatPattern | the initial pattern for the
DecimalFormat object that's used to display
and parse the value of the text field. |
IllegalArgumentException | if the spinners model is not
an instance of SpinnerNumberModel or if
decimalFormatPattern is not a legal
argument to DecimalFormat |
getTextField, SpinnerNumberModel, java.text.DecimalFormat
Diagram: JSpinner