Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JList Selection

Amit Singhall
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

I have a problem related to JList. I want the List selection model to be SingleSelection but when ever i am traversing through the list i want the previous selection to be shown as the same selection color or different one (that's not a issue).So that i can track my selections later on...........

I tried to put the JLabels in the List and on mouse click event in the list i am storing the selection indexes in a temp on each click i have previous selected indexes , then i tried to set the background color of the JLabels for those indexes ....but it's not showing ...i think after click event passes it goes to the list cell render and does as per specified in the render for the whole list...

Is there any way to do so....................

Waiting for your suggestions......

Thanks in advance
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic