• Post Reply Bookmark Topic Watch Topic
  • New Topic

JList setSelected Values  RSS feed

 
Durga Penmatsa
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!