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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
package com.clearstream.main;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class EastPanel extends JPanel {
/**
*
*/
private static final long serialVersionUID = 1L;
public JLabel matriculeLabel = new JLabel("Matricule :");
public JLabel nomLabel = new JLabel("Nom :");
public JLabel prenomLabel = new JLabel("Prénom :");
public JLabel fonctionLabel = new JLabel("Fonction :");
public JLabel sexeLabel = new JLabel("Sexe :");
public GridBagConstraints gbc = new GridBagConstraints();
public EastPanel(String name) {
initPanel(name);
}
public void initPanel(String name) {
this.setName(name);
this.setLayout( new GridBagLayout() );
this.gbc.gridx = 0;
this.gbc.gridy = 0;
this.gbc.gridwidth = GridBagConstraints.REMAINDER; // gbc.gridheight = 1;
this.gbc.insets = new Insets(0, 5, 0, 0);
this.gbc.anchor = GridBagConstraints.BASELINE_LEADING;
this.add(this.matriculeLabel, gbc);
this.gbc.gridx = 1;
this.gbc.gridy = 1;
this.gbc.gridwidth = 1;
this.gbc.gridheight = 1;
this.gbc.anchor = GridBagConstraints.BASELINE_LEADING;
this.gbc.insets = new Insets(0, 5, 0, 0);
this.add(this.nomLabel, gbc);
this.gbc.gridx = 1;
this.gbc.gridy = 2;
this.gbc.gridwidth = 1;
this.gbc.gridheight = 1;
this.gbc.fill = GridBagConstraints.NONE;
this.gbc.anchor = GridBagConstraints.BASELINE_LEADING;
this.gbc.insets = new Insets(0, 5, 0, 0);
this.add(this.prenomLabel, gbc);
this.gbc.gridx = 1;
this.gbc.gridwidth = 1;
this.gbc.gridheight = 1;
this.gbc.gridy = 3;
this.gbc.fill = GridBagConstraints.NONE;
this.gbc.anchor = GridBagConstraints.BASELINE_LEADING;
this.gbc.insets = new Insets(0, 5, 0, 0);
this.add(this.fonctionLabel, gbc);
this.gbc.gridy = 4;
this.gbc.gridx = 1;
this.gbc.gridwidth = 1;
this.gbc.gridheight = 1;
this.gbc.anchor = GridBagConstraints.BASELINE_LEADING;
this.gbc.insets = new Insets(0, 5, 0, 0);
this.add(this.sexeLabel, gbc);
this.setPreferredSize( new Dimension( 700,200 ) );
}
} |
Partager