@Nullable @Override protected JComponent createCenterPanel() { JPanel panel = new JPanel(new BorderLayout()); panel.add(createNamePanel(), BorderLayout.CENTER); if (myOccurrencesCount > 1) panel.add(createReplaceAllPanel(), BorderLayout.SOUTH); panel.setPreferredSize(new Dimension(myNameField.getWidth(), -1)); return panel; }