aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes cant get large selection in Jlist to do 'something' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "cant get large selection in Jlist to do Watch "cant get large selection in Jlist to do New topic
Author

cant get large selection in Jlist to do 'something'

shaon husain
Ranch Hand

Joined: Mar 20, 2013
Posts: 37
after adding a few items to Jlsit i can remove many item in one go:



however when i try and get the item to do carry out a method, it doesnt seem to work,

however it only does the first one eg
if ive selected 3 items, 5,6, and 7, it would do the method 3 times on item 5
or if ive slect 4 items, 2,3,4,and 5 it would do the method 4 times on item 2
and not on the rest of the item,

what am i doing wrong.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2183
    
    7
Where in you loop do you actually get a selected item from the list?
shaon husain
Ranch Hand

Joined: Mar 20, 2013
Posts: 37
Rob Camick wrote:Where in you loop do you actually get a selected item from the list?


i cannot just simply add



when i do there isnt anything i can do.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2183
    
    7
Did you try the getSelectedValues() method?
shaon husain
Ranch Hand

Joined: Mar 20, 2013
Posts: 37
Rob Camick wrote:Did you try the getSelectedValues() method?


when i do list.getSelectedValues(), i get a line through it, and it doesnt work, in my case,
 
wood burning stoves
 
subject: cant get large selection in Jlist to do 'something'