JComponent () { JPanel panel = new JPanel(new GridBagLayout()); panel.add(myNameLabel, new GridBagConstraints( 0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, JBUI.insetsBottom(4), 0, 0 )); panel.add(myNameSuggestionsField.getComponent(), new GridBagConstraints( 0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, JBUI.insetsBottom(8), 0, 0 )); return panel; }