JComponent () { JComponent component = myConfigEditor.getComponent(); if (myConfigEditor instanceof AdjustingTabSettingsEditor) { JPanel panel = new JPanel(new BorderLayout()); UiNotifyConnector connector = UiNotifyConnector.installOn(panel, new Activatable() { private boolean myIsEmpty = true; @Override public void showNotify() { if (myIsEmpty) { panel.add(component, BorderLayout.CENTER); panel.revalidate(); panel.repaint(); myIsEmpty = false; } } @Override public void hideNotify() { if (!myIsEmpty) { panel.removeAll(); panel.revalidate(); panel.repaint(); myIsEmpty = true; } } }); Disposer.register(this, connector); return panel; } return component; }