public static final int findValueInListBox ( ListBox list , String value ) { for ( int i = 0 ; i < list . getItemCount ( ) ; i ++ ) { if ( value . equals ( list . getValue ( i ) ) ) { return i ; } } return - 1 ; }
Utility function to find the first index of a value in a ListBox .