JPanel () { JPanel panel = new JPanel(); panel.setBorder(IdeBorderFactory.createTitledBorder(EditorBundle.message("print.margins.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; panel.add(new MyLabel(EditorBundle.message("print.margins.top.label")), gbConstraints); myTopMarginField = new MyTextField(6); gbConstraints.weightx = 0; gbConstraints.gridx = 1; panel.add(myTopMarginField, gbConstraints); gbConstraints.weightx = 1; gbConstraints.gridx = 2; panel.add(new MyLabel(EditorBundle.message("print.margins.bottom.label")), gbConstraints); myBottomMarginField = new MyTextField(6); gbConstraints.weightx = 0; gbConstraints.gridx = 3; panel.add(myBottomMarginField, gbConstraints); gbConstraints.weightx = 1; gbConstraints.gridx = 0; gbConstraints.gridy++; panel.add(new MyLabel(EditorBundle.message("print.margins.left.label")), gbConstraints); myLeftMarginField = new MyTextField(6); gbConstraints.weightx = 0; gbConstraints.gridx = 1; panel.add(myLeftMarginField, gbConstraints); gbConstraints.weightx = 1; gbConstraints.gridx = 2; panel.add(new MyLabel(EditorBundle.message("print.margins.right.label")), gbConstraints); myRightMarginField = new MyTextField(6); gbConstraints.weightx = 0; gbConstraints.gridx = 3; panel.add(myRightMarginField, gbConstraints); return panel; }