• Post Reply Bookmark Topic Watch Topic
  • New Topic

Finding an objects index in a list?  RSS feed

 
Michael Crutcher
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Jlist whose list model is built with an array of objects. I have another aray of objects that is a subset of the first array (in other words the list might have objects 1-7 and the subset array has objects 2, 4, and 6).
I would like to select all of the indexes of the objects in the second array. JList has a method to select an index by supplying an object:

However if called several times it sets the selected only to the last object it was sent. There is not equivelant method that takes an object array. I didn't seem to find a method that gets the index of a particular Object.
Is there something I'm missing? Could somebody help me out?
Please? Nobody has responded to the three other questions I've asked.
Thanks,
Michael Crutcher
 
Michael Crutcher
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got around it by doing this: (duh)

Still, is there no direct way to know what index position an object is at without overiding the list model?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!