TableCellEditor (final ScopeSetting scopeSetting) { return new AbstractTableCellEditor() { private final JBComboBoxTableCellEditorComponent myProfilesChooser = new JBComboBoxTableCellEditorComponent(); @Override public Object getCellEditorValue() { return myProfilesChooser.getEditorValue(); } @Override public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { final List<CopyrightProfile> copyrights = new ArrayList<>(myProfilesModel.getAllProfiles().values()); copyrights.sort((o1, o2) -> o1.getName().compareToIgnoreCase(o2.getName())); myProfilesChooser.setCell(table, row, column); myProfilesChooser.setOptions(copyrights.toArray()); myProfilesChooser.setDefaultValue(scopeSetting.getProfile()); myProfilesChooser.setToString(o -> ((CopyrightProfile)o).getName()); return myProfilesChooser; } }; }