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 and the fly likes JList deselection problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JList deselection problem" Watch "JList deselection problem" New topic
Author

JList deselection problem

Vikas Kumar Sahu
Ranch Hand

Joined: Dec 02, 2003
Posts: 59
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

Joined: Jun 09, 2003
Posts: 4632
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JList deselection problem
 
Similar Threads
Using Drag and drop with JLists to fire an event
Single interval selection in two lists
need help on JList
About JList listener
Adding elements to a JList dynamically