JPanel () { JPanel panel = new JPanel(); panel.setBorder(IdeBorderFactory.createTitledBorder(EditorBundle.message("print.wrapping.group"))); panel.setLayout(new GridBagLayout()); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.gridy = 0; gbConstraints.gridx = 0; gbConstraints.gridwidth = 1; gbConstraints.gridheight = 1; gbConstraints.weightx = 1; gbConstraints.fill = GridBagConstraints.BOTH; myRbNoWrap = new JRadioButton(EditorBundle.message("print.wrapping.none.radio")); panel.add(myRbNoWrap, gbConstraints); myRbWrapAtWordBreaks = new JRadioButton(EditorBundle.message("print.wrapping.word.breaks.radio")); gbConstraints.gridy++; panel.add(myRbWrapAtWordBreaks, gbConstraints); ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(myRbNoWrap); buttonGroup.add(myRbWrapAtWordBreaks); return panel; }