/** * Returns the index of the currently selected item. * * @return The index of the currently selected item, or -1 if no item is selected. */ public int getSelectedIndex() { Comboitem item = getSelectedItem(); return item == null ? -1 : item.getIndex(); }