• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jspinner question

 
john mattucci
Ranch Hand
Posts: 331
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how would I go about setting the initial value i.e. lets say I have a spinner with a list of values and I want the initial value to be the 7th or nth value of the list how do I go about doing this?

Thank you all
 
Craig Wood
Ranch Hand
Posts: 1535
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
spinner.setValue(Object value);
If you need to inspect the values contained in the model you can move through them with the 'getPreviousValue' and 'getNextValue' methods (which are contained in both the JSpinner and its model classes).
[ May 27, 2005: Message edited by: Craig Wood ]
 
Pat Hays
Ranch Hand
Posts: 138
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
spinner.setValue(new Integer(7));

The initial value will be 7
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic