tags:

views:

43

answers:

2

How do I check if a user has anything selected inside a JList?

A: 

It's not optimal, but...

Create a deep copy of the list before it gets changed. Then compare (using equals) the possibly changed list to the copy of the original.

tpdi
+6  A: 

Have you tried JList.isSelectionEmpty()?

Jon Skeet
+1 That should do it
a_horse_with_no_name