Javatpoint Logo
Javatpoint Logo

Java JSpinner

The object of JSpinner class is a single line input field that allows the user to select a number or an object value from an ordered sequence.

JSpinner class declaration

Let's see the declaration for javax.swing.JSpinner class.

Commonly used Contructors:

Constructor Description
JSpinner() It is used to construct a spinner with an Integer SpinnerNumberModel with initial value 0 and no minimum or maximum limits.
JSpinner(SpinnerModel model) It is used to construct a spinner for a given model.

Commonly used Methods:

Method Description
void addChangeListener(ChangeListener listener) It is used to add a listener to the list that is notified each time a change to the model occurs.
Object getValue() It is used to return the current value of the model.

Java JSpinner Example


Java Jspiner 1

Java JSpinner Example with ChangeListener



Java Jspiner 2
Next TopicJava JDialog

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA