1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| panelFenetre= new JPanel();
panelFenetre.setLayout(new BorderLayout());
this.setContentPane(panelFenetre);
// Place les composants
panelFenetre.add(getPanelBouton(), BorderLayout.NORTH);
private JPanel getPanelBouton() {
panelBouton = new JPanel();
panelBouton.setName("panelBoutons");
panelBouton.setLayout(new GridBagLayout());
panelBouton.setBackground(Color.WHITE);
// Place le label du champ texte
GridBagConstraints gridBagLabel1 = new GridBagConstraints();
gridBagLabel1.gridx = 0;
gridBagLabel1.gridy = 0;
gridBagLabel1.insets = new Insets(5, 5, 5, 5);
gridBagLabel1.gridwidth = 1;
gridBagLabel1.gridheight = 1;
gridBagLabel1.weightx = 0;
gridBagLabel1.weighty = 0;
gridBagLabel1.ipadx = 0;
gridBagLabel1.ipady = 0;
gridBagLabel1.anchor = GridBagConstraints.NORTHWEST;
panelBouton.add(getLblPhrase(), gridBagLabel1);
GridBagConstraints gridBagChampTexte = new GridBagConstraints();
gridBagChampTexte.gridx = 0;
gridBagChampTexte.gridy = 1;
gridBagChampTexte.insets = new Insets(5, 5, 5, 5);
gridBagChampTexte.gridwidth = 1;
gridBagChampTexte.gridheight = 1;
gridBagChampTexte.weightx = 0;
gridBagChampTexte.weighty = 0;
gridBagChampTexte.ipadx = 0;
gridBagChampTexte.ipady = 0;
gridBagChampTexte.anchor = GridBagConstraints.NORTHWEST;
panelBouton.add(getTxtPhrase(), gridBagChampTexte);
// Place le bouton Valider
GridBagConstraints gridBagValider = new GridBagConstraints();
gridBagValider.gridx = 1;
gridBagValider.gridy = 2;
gridBagValider.insets = new Insets(5, 5, 5, 5);
gridBagValider.gridwidth = 1;
gridBagValider.gridheight = 1;
gridBagValider.weightx = 0;
gridBagValider.weighty = 0;
gridBagValider.ipadx = 0;
gridBagValider.ipady = 0;
gridBagValider.anchor = GridBagConstraints.NORTHWEST;
panelBouton.add(getCmdValider(), gridBagValider);
return panelBouton;
} |
Partager