JComponent () { myPanel = new JPanel(new BorderLayout(10, 5)); final JPanel contentPanel = new JPanel(new BorderLayout(4, 0)); myPanel.add(contentPanel, BorderLayout.NORTH); contentPanel.add(new JLabel(GroovyBundle.message("framework.0.home.label", myFrameworkName)), BorderLayout.WEST); myPathField = new TextFieldWithBrowseButton(); contentPanel.add(myPathField); myPathField .addBrowseFolderListener(GroovyBundle.message("select.framework.0.home.title", myFrameworkName), "", myProject, new FileChooserDescriptor(false, true, false, false, false, false) { @Override public boolean isFileSelectable(@Nullable VirtualFile file) { return file != null && isSdkHome(file); } }); return myPanel; }