Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cant get large selection in Jlist to do 'something'

 
shaon husain
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2600
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where in you loop do you actually get a selected item from the list?
 
shaon husain
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2600
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try the getSelectedValues() method?
 
shaon husain
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic