} else {
else {
  public int getSelectedIndex()  {    Object selectedItem = getSelectedItem();        if (selectedItem != null) {			if(dataModel instanceof DefaultComboBoxModel) {			// Uses special method of DefaultComboBoxModel to retrieve the index.      return ((DefaultComboBoxModel) dataModel).getIndexOf(selectedItem);		} else {			// Iterates over all items to retrieve the index.			int size = dataModel.getSize();				  		for(int i=0; i < size; i++) {	  			Object o = dataModel.getElementAt(i);	  							// XXX: Is special handling of ComparableS neccessary?	  			if((selectedItem != null) ? selectedItem.equals(o) : o == null) {	  				return i;	  			}	  		}		}    }    // returns that no item is currently selected    return -1;  }