JComponent () { JPanel mainPanel = new JPanel(new GridBagLayout()); final TitledSeparator separator = new TitledSeparator(); mainPanel.add(separator, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, JBInsets.emptyInsets(), 0, 0)); myList = createTargetVariableChooser(); myList.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { validateTextFields(e.getFirstIndex()); } }); separator.setText(RefactoringBundle.message("moveInstanceMethod.select.an.instance.parameter")); final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myList); mainPanel.add(scrollPane, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, JBInsets.emptyInsets(), 0, 0)); myVisibilityPanel = createVisibilityPanel(); mainPanel.add(myVisibilityPanel, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, JBInsets.emptyInsets(), 0, 0)); final JPanel parametersPanel = createParametersPanel(); if (parametersPanel != null) { mainPanel.add(parametersPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, JBInsets.emptyInsets(), 0, 0)); } separator.setLabelFor(myList); validateTextFields(myList.getSelectedIndex()); updateOnChanged(myList); return mainPanel; }