Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get selected value of a number model spinner

How do you get the selected value from a number based spinner in java?

As i side note why does android always come up under the search term spinner

like image 367
nmu Avatar asked Dec 18 '25 15:12

nmu


1 Answers

A JSpinner has a SpinnerModel, that stores the selected Value, Bounds of the Values and step sizes, etc.

JSpinner spinner;
Object value = spinner.getModel().getValue();

Also other Spinners work this way. It is based on the Model-View-Controller(MVC)-Pattern and seperates the Data from their presentation and manipulation.

like image 157
Simulant Avatar answered Dec 21 '25 05:12

Simulant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!