public static int populateCombo(final Combo combo,final String[] values,final String initialValue){
  Check.notNull(combo,"combo");
  Check.notNull(values,"values");
  if (values.length == 0) {
    return -1;
  }
  int selectedIndex=0;
  for (int i=0; i < values.length; i++) {
    final String value=values[i];
    if (value.equals(initialValue)) {
      selectedIndex=i;
    }
    combo.add(value);
  }
  combo.select(selectedIndex);
  setVisibleItemCount(combo);
  return selectedIndex;
}

public static int populateCombo ( final Combo combo , final String [ ] values , final String initialValue ) { Check . notNull ( combo , "combo" ) ; Check . notNull ( values , "values" ) ; if ( values . length == 0 ) { return - 1 ; } int selectedIndex = 0 ; for ( int i = 0 ; i < values . length ; i ++ ) { final String value = values [ i ] ; if ( value . equals ( initialValue ) ) { selectedIndex = i ; } combo . add ( value ) ; } combo . select ( selectedIndex ) ; setVisibleItemCount ( combo ) ; return selectedIndex ; }
populates the combo with the specified values . the specified initial value is set as the initial selection it it appears in the array of values , otherwise the first value is selected .
