JComponent () { JPanel panel = PanelFactory.grid() .add(PanelFactory.panel(JBUI.Panels.simplePanel(UIUtil.DEFAULT_HGAP, UIUtil.DEFAULT_VGAP) .addToCenter(myRepositoryUrlCombobox) .addToRight(myTestButton)) .withLabel(DvcsBundle.message("clone.repository.url.label"))) .add(PanelFactory.panel(myDirectoryField) .withLabel(DvcsBundle.message("clone.destination.directory.label"))) .createPanel(); panel.setPreferredSize(new JBDimension(500, 50, true)); return panel; }