JPanel () { JPanel radioButtonPanel = new JPanel(new GridBagLayout()); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.insets = JBInsets.create(4, 8); gbConstraints.weighty = 1; gbConstraints.weightx = 1; gbConstraints.gridy = 0; gbConstraints.gridwidth = GridBagConstraints.REMAINDER; gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.anchor = GridBagConstraints.WEST; radioButtonPanel.add( new JLabel(JavaRefactoringBundle.message("replace.fields.used.in.expressions.with.their.getters")), gbConstraints); myReplaceFieldsWithGettersNoneRadio = new JRadioButton(); myReplaceFieldsWithGettersNoneRadio.setText(JavaRefactoringBundle.message("do.not.replace")); myReplaceFieldsWithGettersInaccessibleRadio = new JRadioButton(); myReplaceFieldsWithGettersInaccessibleRadio.setText(JavaRefactoringBundle.message("replace.fields.inaccessible.in.usage.context")); myReplaceFieldsWithGettersAllRadio = new JRadioButton(); myReplaceFieldsWithGettersAllRadio.setText(JavaRefactoringBundle.message("replace.all.fields")); gbConstraints.gridy++; radioButtonPanel.add(myReplaceFieldsWithGettersNoneRadio, gbConstraints); gbConstraints.gridy++; radioButtonPanel.add(myReplaceFieldsWithGettersInaccessibleRadio, gbConstraints); gbConstraints.gridy++; radioButtonPanel.add(myReplaceFieldsWithGettersAllRadio, gbConstraints); final int currentSetting = JavaRefactoringSettings.getInstance().INTRODUCE_PARAMETER_REPLACE_FIELDS_WITH_GETTERS; myReplaceFieldsWithGettersButtonGroup.add(myReplaceFieldsWithGettersNoneRadio); myReplaceFieldsWithGettersButtonGroup.add(myReplaceFieldsWithGettersInaccessibleRadio); myReplaceFieldsWithGettersButtonGroup.add(myReplaceFieldsWithGettersAllRadio); if(currentSetting == IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_ALL) { myReplaceFieldsWithGettersAllRadio.setSelected(true); } else if(currentSetting == IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_INACCESSIBLE) { myReplaceFieldsWithGettersInaccessibleRadio.setSelected(true); } else if(currentSetting == IntroduceParameterRefactoring.REPLACE_FIELDS_WITH_GETTERS_NONE) { myReplaceFieldsWithGettersNoneRadio.setSelected(true); } return radioButtonPanel; }