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 Can't do multiple selections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Can Watch "Can New topic
Author

Can't do multiple selections

Kevin Tysen
Ranch Hand

Joined: Oct 12, 2005
Posts: 255
On the API of JList there is a link to "How To Use Lists" in the java tutorial, and on that page there are pictures of the different kind of selection modes, single selection, single interval selection, multiple interval selection. In single selection, two is selected, in single interval selection, two,three,four are selected, and in multiple interval selection, one,two,four are selected. I assume those are examples of the possible selections of JList.
However, I tried out the online ListSelectionDemo on the page there and I was unable to select more than one item after changing to the single interval selection and the multiple interval selection. Also, in the program I wrote, I can't select more than one item at a time on my JList even after changing to multiple interval selection. Am I selecting wrong or something? Is there something wrong with this computer?

http://java.sun.com/docs/books/tutorial/uiswing/examples/events/index.html#ListSelectionDemo
(ListSelectionDemo)
Peter Taucher
Ranch Hand

Joined: Nov 18, 2006
Posts: 174
You must get something wrong. The demo works quite fine. Did you use <Ctrl> and/or <Shift> for the interval selections to happen?


Censorship is the younger of two shameful sisters, the older one bears the name inquisition.
-- Johann Nepomuk Nestroy
Kevin Tysen
Ranch Hand

Joined: Oct 12, 2005
Posts: 255
Oh, I see. I have to press SHIFT or CTRL keys while using the mouse. It works now! Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't do multiple selections
 
Similar Threads
JList deleting multiple items
combo box with checkboxes
Drag and Drop from JList to JTree
Combo box selection
JList