35 lines
1.0 KiB
Java
35 lines
1.0 KiB
Java
package fr.iutfbleau.projetIHM2022FI2.ROOT.View;
|
|
|
|
import javax.swing.JLabel;
|
|
import javax.swing.JPanel;
|
|
|
|
import fr.iutfbleau.projetIHM2022FI2.API.Etudiant;
|
|
|
|
import javax.swing.JButton;
|
|
import java.awt.*;
|
|
import java.awt.event.ActionListener;
|
|
public class PanelEtudiant extends JPanel{
|
|
private JButton supprimer;
|
|
private JButton deplacer;
|
|
public PanelEtudiant(Etudiant e){
|
|
super(new GridLayout(1,2,20,10));
|
|
JLabel label=new JLabel(" "+e.getNom()+" "+e.getPrenom()+" "+e.getId(), JLabel.LEFT);
|
|
this.supprimer=new JButton("supr");
|
|
this.deplacer=new JButton("change");
|
|
|
|
this.add(label);
|
|
JPanel bouton=new JPanel(new GridLayout(1,2));
|
|
bouton.add(this.supprimer);
|
|
bouton.add(this.deplacer);
|
|
this.add(bouton);
|
|
}
|
|
|
|
public void addActionDeleteListener(ActionListener a){
|
|
this.supprimer.addActionListener(a);
|
|
}
|
|
|
|
public void addActionChangeListener(ActionListener a){
|
|
this.deplacer.addActionListener(a);
|
|
}
|
|
}
|