• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Select multiple items in JScrollpane while pressing Control Key

 
Joseph Labrousse
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help me with the codes to select multiple items in a list using the control key?
Thanks
Joseph
 
Kriti Garg
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

yes u can select muliple items using cntrl or shift keys by getting the selected items of the list and iterating them ,like this...

......Code.........

Object obj[] = List.getSelectedValues();
int length = List.getSelectedValues().length;
if (length != -1) {
for (int i = 0; i < length; i++) {
///ur logic

}
}

Bbye
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic