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 / JFace and the fly likes JList setSelected Values Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "JList setSelected Values" Watch "JList setSelected Values" New topic
Author

JList setSelected Values

Durga Penmatsa
Greenhorn

Joined: Aug 14, 2001
Posts: 23
Hi,
I have a JList, I am looking for a method like setSelectedValues(Object[]), but api does not have this method, can some one help me if there is any work around for this.
Cheers
Durga
Durga Penmatsa
Greenhorn

Joined: Aug 14, 2001
Posts: 23
Hi All,
I had to right my own code. I tried going thru entire list, test for matching objects and used setSelectedValue() for matching object, but that did not work. I had to find out indices of matching objects and use setSelectedIndices(int[]).
Any doubts
Durga
Originally posted by Durga Penmatsa:
Hi,
I have a JList, I am looking for a method like setSelectedValues(Object[]), but api does not have this method, can some one help me if there is any work around for this.
Cheers
Durga

 
 
subject: JList setSelected Values
 
Threads others viewed
How can you show data from a specific colum in a JList? through JDBC
need help on JList
How to show JCheckBox component as elements of a JList ?
JList Select on MouseEntered
update a JList based on an Array
developer file tools