if (dataModel instanceof DefaultComboBoxModel) {
if (dataModel instanceof DefaultComboBoxModel)
  public void removeAllItems()  {    if (dataModel instanceof DefaultComboBoxModel) {    	// Uses special method if we have a DefaultComboBoxModel.      ((DefaultComboBoxModel) dataModel).removeAllElements();    } else if(dataModel instanceof MutableComboBoxModel){    	// Iterates over all items and removes each.    	MutableComboBoxModel mcbm = (MutableComboBoxModel) dataModel;	/* We intentionally remove the items backwards to support	 * models which shift their content to the beginning (e.g.	 * linked lists) 	 */     	    	for(int i=mcbm.getSize()-1; i >= 0; i--) {    		mcbm.removeElementAt(i);    	}    	    } else {	throw new RuntimeException("Unable to remove the items because the data model it is not an instance of MutableComboBoxModel.");    }        }