JPanel (@NlsContexts.BorderTitle String name, JTextField lineTextField, JComboBox<PrintSettings.Placement> linePlacementCombo, JComboBox<PrintSettings.Alignment> lineAlignmentCombo) { JPanel panel = new JPanel(); panel.setBorder(IdeBorderFactory.createTitledBorder(name)); panel.setLayout(new GridBagLayout()); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.gridy = 0; gbConstraints.gridx = 0; gbConstraints.gridwidth = 1; gbConstraints.gridheight = 1; gbConstraints.weightx = 0; gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.insets = JBUI.insetsBottom(6); panel.add(new MyLabel(EditorBundle.message("print.header.text.line.editbox")), gbConstraints); gbConstraints.gridx = 1; gbConstraints.gridwidth = 4; gbConstraints.weightx = 1; panel.add(lineTextField, gbConstraints); gbConstraints.gridwidth = 1; gbConstraints.gridy++; gbConstraints.gridx = 0; gbConstraints.weightx = 0; panel.add(new MyLabel(EditorBundle.message("print.header.placement.combobox")), gbConstraints); linePlacementCombo.addItem(PrintSettings.Placement.Header); linePlacementCombo.addItem(PrintSettings.Placement.Footer); gbConstraints.gridx = 1; gbConstraints.weightx = 0; panel.add(linePlacementCombo, gbConstraints); gbConstraints.gridx = 2; gbConstraints.weightx = 1; panel.add(new MyTailPanel(), gbConstraints); gbConstraints.gridx = 3; gbConstraints.weightx = 0; panel.add(new MyLabel(EditorBundle.message("print.header.alignment.combobox")), gbConstraints); lineAlignmentCombo.addItem(PrintSettings.Alignment.Left); lineAlignmentCombo.addItem(PrintSettings.Alignment.Center); lineAlignmentCombo.addItem(PrintSettings.Alignment.Right); gbConstraints.gridx = 4; gbConstraints.weightx = 0; panel.add(lineAlignmentCombo, gbConstraints); return panel; }