JComponent () { JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.insets = new Insets(4, 0, 4, 8); gbConstraints.weighty = 1; gbConstraints.weightx = 1; gbConstraints.gridy = 0; gbConstraints.gridwidth = GridBagConstraints.REMAINDER; gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.anchor = GridBagConstraints.WEST; final JLabel classComboLabel = new JLabel(); panel.add(classComboLabel, gbConstraints); myClassCombo = new JComboBox(mySuperClasses.toArray()); initClassCombo(myClassCombo); classComboLabel.setText(RefactoringBundle.message("pull.up.members.to", UsageViewUtil.getLongName(myClass))); classComboLabel.setLabelFor(myClassCombo); final Class preselection = getPreselection(); int indexToSelect = 0; if (preselection != null) { indexToSelect = mySuperClasses.indexOf(preselection); } myClassCombo.setSelectedIndex(indexToSelect); myClassCombo.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { if (e.getStateChange() == ItemEvent.SELECTED) { updateMemberInfo(); } } }); gbConstraints.gridy++; panel.add(myClassCombo, gbConstraints); return panel; }