42 lines
1.1 KiB
Java
42 lines
1.1 KiB
Java
|
package fr.iutfbleau.projetIHM2022FI2.Graphic.View;
|
||
|
|
||
|
import javax.swing.JLabel;
|
||
|
import javax.swing.JPanel;
|
||
|
|
||
|
import fr.iutfbleau.projetIHM2022FI2.API.Etudiant;
|
||
|
|
||
|
import javax.swing.JButton;
|
||
|
import java.awt.*;
|
||
|
|
||
|
public class PanelEtudiant extends JPanel{
|
||
|
private JLabel nom;
|
||
|
private Etudiant e;
|
||
|
private JButton renomer;
|
||
|
private JButton supprimer;
|
||
|
private JButton deplacer;
|
||
|
public PanelEtudiant(Etudiant e){
|
||
|
super(new GridBagLayout());
|
||
|
this.nom=new JLabel(e.getNom()+" "+e.getPrenom()+" "+e.getId(), JLabel.LEFT);
|
||
|
|
||
|
this.renomer=new JButton("r");
|
||
|
this.supprimer=new JButton("-");
|
||
|
this.deplacer=new JButton("c");
|
||
|
GridBagConstraints cbg=new GridBagConstraints();
|
||
|
|
||
|
cbg.gridy=0;
|
||
|
cbg.anchor=GridBagConstraints.EAST;
|
||
|
cbg.fill=GridBagConstraints.BOTH;
|
||
|
|
||
|
this.add(this.nom, cbg);
|
||
|
|
||
|
cbg.gridwidth=0;
|
||
|
cbg.gridheight=0;
|
||
|
cbg.anchor=GridBagConstraints.EAST;
|
||
|
cbg.fill=GridBagConstraints.NONE;
|
||
|
|
||
|
this.add(this.renomer, cbg);
|
||
|
this.add(this.supprimer, cbg);
|
||
|
this.add(this.deplacer, cbg);
|
||
|
}
|
||
|
}
|