aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Need help with JList selection modes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Need help with JList selection modes" Watch "Need help with JList selection modes" New topic
Author

Need help with JList selection modes

Robert Miller
Ranch Hand

Joined: Jun 18, 2004
Posts: 56
I have an application using a JList and I want to implement the additional restriction that as long as the list is non-empty there will always be one element selected. I am using the SINGLE_SELECTION model but that allows the user to deselect the current item and leave no elements selected. I suspect I can accomplish what I want using a ListSelectionListener but I haven't found enough documentation on that object for me to determine whether it would be helpful.

Is there anyone out there who can help me out with this?

Thanks!

Robert
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
 
jQuery in Action, 2nd edition
 
subject: Need help with JList selection modes