From 1caa8d9f9216b3a03a8cb7fb418166ef474a140f Mon Sep 17 00:00:00 2001 From: Aylane SEHL Date: Wed, 22 Oct 2025 23:04:37 +0200 Subject: [PATCH] =?UTF-8?q?T=C3=A9l=C3=A9verser=20les=20fichiers=20vers=20?= =?UTF-8?q?"src/fr/iutfbleau/papillon"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajout des fichiers pour les boutons (CRUD) --- src/fr/iutfbleau/papillon/BtnAjouter.java | 30 +++++++++++ src/fr/iutfbleau/papillon/BtnModifier.java | 57 +++++++++++++++++++++ src/fr/iutfbleau/papillon/BtnSupprimer.java | 49 ++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 src/fr/iutfbleau/papillon/BtnAjouter.java create mode 100644 src/fr/iutfbleau/papillon/BtnModifier.java create mode 100644 src/fr/iutfbleau/papillon/BtnSupprimer.java diff --git a/src/fr/iutfbleau/papillon/BtnAjouter.java b/src/fr/iutfbleau/papillon/BtnAjouter.java new file mode 100644 index 0000000..d26c297 --- /dev/null +++ b/src/fr/iutfbleau/papillon/BtnAjouter.java @@ -0,0 +1,30 @@ +// package fr.iutfbleau.papillon; + +import java.util.ArrayList; +import java.util.List; +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class BtnAjouter extends JButton implements ActionListener{ + private GestionRappel ges; + private Main main; + + public BtnAjouter(Main main){ + super("Ajouter"); + this.main = main; + setPreferredSize(new Dimension(120,25)); + addActionListener(this); + } + + public void actionPerformed(ActionEvent e){ + if(e.getSource()==this){ + + FenetreAjout f = new FenetreAjout(main); + // cacher la fenetre actuelle et montrer celle d ajout + f.setLocation(main.getLocation()); // récupère la position actuelle de Main,place FenetreAjout au même endroit + f.setVisible(true); + main.setVisible(false); + } + } +} \ No newline at end of file diff --git a/src/fr/iutfbleau/papillon/BtnModifier.java b/src/fr/iutfbleau/papillon/BtnModifier.java new file mode 100644 index 0000000..9959908 --- /dev/null +++ b/src/fr/iutfbleau/papillon/BtnModifier.java @@ -0,0 +1,57 @@ +// package fr.iutfbleau.papillon; + +import java.util.ArrayList; +import java.util.List; +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class BtnModifier extends JButton implements ActionListener{ + + private GestionRappel ges; + private Rappel rappel; + private Main main; + + public BtnModifier(Main main){ + super("Modifier"); + this.main = main; + setPreferredSize(new Dimension(120,25)); + addActionListener(this); + } + + public void actionPerformed(ActionEvent e){ + + if (e.getSource() == this) { + ges = new GestionRappel(); + int count = 0; + List listRpl = new ArrayList<>(); + PanelRappel pr; + + listRpl = main.getPanelRpl(); + for(int i = 0; i1){ + JOptionPane.showMessageDialog(main, "Sélectionnez seulement 1 rappel à modifier"); + return; + } + return; + } + } +} \ No newline at end of file diff --git a/src/fr/iutfbleau/papillon/BtnSupprimer.java b/src/fr/iutfbleau/papillon/BtnSupprimer.java new file mode 100644 index 0000000..bc20e66 --- /dev/null +++ b/src/fr/iutfbleau/papillon/BtnSupprimer.java @@ -0,0 +1,49 @@ +// package fr.iutfbleau.papillon; + +import java.util.ArrayList; +import java.util.List; +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class BtnSupprimer extends JButton implements ActionListener{ + private GestionRappel ges; + private Main main; + + public BtnSupprimer(Main main){ + super("Supprimer"); + this.main = main; + setPreferredSize(new Dimension(120,25)); + addActionListener(this); + } + public void actionPerformed(ActionEvent e){ + + if(e.getSource()==this){ + + ges = new GestionRappel(); + int count = 0; + List listRpl = new ArrayList<>(); + PanelRappel pr; + + listRpl = main.getPanelRpl(); + for(int i = 0; i