Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Can't do multiple selections

 
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You must get something wrong. The demo works quite fine. Did you use <Ctrl> and/or <Shift> for the interval selections to happen?
 
Kevin Tysen
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, I see. I have to press SHIFT or CTRL keys while using the mouse. It works now! Thank you.
 
I'm THIS CLOSE to ruling the world! Right after reading this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic