wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes jspinner question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "jspinner question" Watch "jspinner question" New topic

jspinner question

john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
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

Joined: Jan 14, 2004
Posts: 1535
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

Joined: Aug 20, 2004
Posts: 138
spinner.setValue(new Integer(7));

The initial value will be 7

Download Java GUI Builder, <a href="http://www.mars3000.com" target="_blank" rel="nofollow">http://www.mars3000.com</a>
I agree. Here's the link: http://aspose.com/file-tools
subject: jspinner question
Similar Threads
String manipulation
retreive selected value of list box
Help needed in execution Sequence
Dependent select list query
Triggering execute() without form submit