JPanel () { final GridBag c = new GridBag().setDefaultAnchor(GridBagConstraints.WEST).setDefaultInsets(1, 1, 1, 1); final JPanel namePanel = new JPanel(new GridBagLayout()); final JLabel typeLabel = new JLabel(UIUtil.replaceMnemonicAmpersand(GroovyBundle.message("introduce.variable.type.label"))); c.nextLine().next().weightx(0).fillCellNone(); namePanel.add(typeLabel, c); myTypeComboBox = GrTypeComboBox.createTypeComboBoxFromExpression(myExpression, GroovyApplicationSettings.getInstance().INTRODUCE_LOCAL_SELECT_DEF); c.next().weightx(1).fillCellHorizontally(); namePanel.add(myTypeComboBox, c); typeLabel.setLabelFor(myTypeComboBox); final JLabel nameLabel = new JLabel(UIUtil.replaceMnemonicAmpersand(GroovyBundle.message("introduce.variable.name.label"))); c.nextLine().next().weightx(0).fillCellNone(); namePanel.add(nameLabel, c); myNameField = setUpNameComboBox(); c.next().weightx(1).fillCellHorizontally(); namePanel.add(myNameField, c); nameLabel.setLabelFor(myNameField); GrTypeComboBox.registerUpDownHint(myNameField, myTypeComboBox); return namePanel; }