Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JList deselection problem

 
Vikas Kumar Sahu
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I m working on JList what I want that I m describing you ..
I am able to select a perticular element or group of elments in the JList
but I am not able to understand that how I generate a deselection event.
How I have that information that a selected element has now been deselected.
Thanks In advance..
Regards -
Vikas
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not sure I'm reading this correct
to deselect:- list.clearSelection();
to find out of a de-selection - in valueChanged() check for list.getSelectedIndex() == -1
something like this
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic