• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSpinner

 
Tom Boyce
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am attempting to use a JSpinner control to allow a user to select a depth. I need the value selected to do further calculations. I am using JBuilder personal edition and have named the spinner depthJS. A new instance is automatically created:
JSpinner depthJS = new JSpinner();
there is also this generated:
JSpinner jSpinner1 = new JSpinner();
both of these are declared at class level.
How to I get either int or double value out to perform further calculations? Please Help!
Tom
 
VIJAY Yadlapati
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing to do with variable names. You have only to deal with methods available on JSpinner and its Model. You have to use SpinnerNumberModel for your application and call getValue() on either JSpinner or Model to get current value.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!