public void setSelectedItem(Object element) {
        if (element == null) {
            if (elementIndex != -1) {
                elementIndex = -1;
                fireContentsChanged(this, -1, -1);
            }
        } else if (element instanceof String) {
            for (int i=0; i<elementTypeStrings.length; i++) {
                if (elementTypeStrings[i].equals((String)element)) {
                    if (elementIndex != i) {
                        elementIndex = i;
                        fireContentsChanged(this, -1, -1);
                    }
                    
                    break;
                }
            }
        }
    }