File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JSpinner in Swings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JSpinner in Swings" Watch "JSpinner in Swings" New topic
Author

JSpinner in Swings

bolloju bnm
Greenhorn

Joined: May 15, 2007
Posts: 11
hi
In my project i came across a situation like
i have to get the selectedItemindex from JSpinner.
how to get it.please give me the quick reply.
Kaydell Leavitt
Ranch Hand

Joined: Nov 18, 2006
Posts: 689

The following Google search command will take you to Sun's Tutorial on JSpinner.

JSpinner Tutorial site:java.sun.com

Kaydell
bolloju bnm
Greenhorn

Joined: May 15, 2007
Posts: 11
I didnot get the correct answer.give me clearly.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
assuming your spinner is set as a SpinnerListModel,
JSpinner spinner = new JSpinner(new SpinnerListModel( [someArray] ));

all you would need is this
System.out.println(java.util.Arrays.asList( [someArray] ).indexOf(spinner.getValue()));
bolloju bnm
Greenhorn

Joined: May 15, 2007
Posts: 11
thank you michael
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSpinner in Swings