void (final String preselect) { final JComponent component = getChildComponent(); if (preselect != null) { if (component instanceof JComboBox) { final DefaultComboBoxModel model = (DefaultComboBoxModel)((JComboBox)component).getModel(); for (int i = 0; i < model.getSize(); i++) { final NamedScope descriptor = (NamedScope)model.getElementAt(i); if (preselect.equals(descriptor.getScopeId())) { ((JComboBox<?>)component).setSelectedIndex(i); break; } } } else { final Object[] options = ((JBComboBoxTableCellEditorComponent)component).getOptions(); for (Object option : options) { final NamedScope descriptor = (NamedScope)option; if (preselect.equals(descriptor.getScopeId())) { ((JBComboBoxTableCellEditorComponent)component).setDefaultValue(descriptor); break; } } } } }