JComponent () { JComponent mainEditorComponent = myMainSettingsEditor.getComponent(); mySettingsPlaceholder = new JPanel(new GridBagLayout()); GridBagConstraints constraints = new GridBagConstraints(); constraints.fill = GridBagConstraints.BOTH; constraints.weightx = 1.0; mySettingsPlaceholder.add(mainEditorComponent, constraints); return mySettingsPlaceholder; }