void (final String contentEntry) { final ContentEntryEditor contentEntryEditor = createContentEntryEditor(contentEntry); contentEntryEditor.initUI(); contentEntryEditor.addContentEntryEditorListener(myContentEntryEditorListener); registerDisposable(new Disposable() { @Override public void dispose() { contentEntryEditor.removeContentEntryEditorListener(myContentEntryEditorListener); } }); myEntryToEditorMap.put(contentEntry, contentEntryEditor); Border border = BorderFactory.createEmptyBorder(2, 2, 0, 2); final JComponent component = contentEntryEditor.getComponent(); final Border componentBorder = component.getBorder(); if (componentBorder != null) { border = BorderFactory.createCompoundBorder(border, componentBorder); } component.setBorder(new EmptyBorder(0, 0, 0, 0)); myEditorsPanel.add(component); }