setSelectedItem("banana"). You could have found it yourself by just reading the javadoc.
Edit: since you changed the question, I’ll change my answer.
If you want to select the item having the “banana” label, then you have two solutions:
- Iterate through the items to find the one (or the index of the one) which has the given label, and then call
setSelectedItem(theFoundItem)(orsetSelectedIndex(theFoundIndex)) - Override
equalsandhashCodeinComboItemso that twoComboIteminstances having the same name are equal, and simply usesetSelectedItem(new ComboItem(anyNumber, "banana"));