public String [ ] getItemsSelected ( ) { List < String > selected = new LinkedList <> ( ) ; for ( int i = getIndexOffset ( ) ; i < listBox . getItemCount ( ) ; i ++ ) { if ( listBox . isItemSelected ( i ) ) { selected . add ( listBox . getValue ( i ) ) ; } } return selected . toArray ( new String [ selected . size ( ) ] ) ; }
Returns all selected values of the list box or empty array if none .