diff --git a/DEV.3.1/TP/TP3/ex1/Controleur.class b/DEV.3.1/TP/TP3/ex1/Controleur.class index 33df858..8c3509e 100644 Binary files a/DEV.3.1/TP/TP3/ex1/Controleur.class and b/DEV.3.1/TP/TP3/ex1/Controleur.class differ diff --git a/DEV.3.1/TP/TP3/ex1/Controleur.java b/DEV.3.1/TP/TP3/ex1/Controleur.java index be2ff7c..4692abf 100644 --- a/DEV.3.1/TP/TP3/ex1/Controleur.java +++ b/DEV.3.1/TP/TP3/ex1/Controleur.java @@ -1,19 +1,18 @@ import java.awt.*; import java.awt.event.*; -import java.awt.event.WindowListener; import javax.swing.*; public class Controleur extends WindowAdapter { - public Controleur() { - - } - - // avant fermeture @Override public void windowClosing(WindowEvent evenement) { - JOptionPane.showConfirmDialog(null, "Êtes-vous sûr de vouloir fermer cette fenêtre ?"); - System.exit(0); + int choice = JOptionPane.showConfirmDialog(null, "Êtes-vous sûr de vouloir fermer cette fenêtre ?"); + if(choice == 0) { + System.exit(0); + } else { + System.out.println(""); + } } -} \ No newline at end of file +} + diff --git a/DEV.3.1/TP/TP3/ex1/Main.class b/DEV.3.1/TP/TP3/ex1/Main.class index e9620cd..f4d9603 100644 Binary files a/DEV.3.1/TP/TP3/ex1/Main.class and b/DEV.3.1/TP/TP3/ex1/Main.class differ diff --git a/DEV.3.1/TP/TP3/ex1/Main.java b/DEV.3.1/TP/TP3/ex1/Main.java index 6a35ca2..cd7b76c 100644 --- a/DEV.3.1/TP/TP3/ex1/Main.java +++ b/DEV.3.1/TP/TP3/ex1/Main.java @@ -1,6 +1,5 @@ public class Main { public static void main(String[] args) { Vue vue = new Vue(); - Controleur controleur = new Controleur(); } } \ No newline at end of file diff --git a/DEV.3.1/TP/TP3/ex1/Vue.class b/DEV.3.1/TP/TP3/ex1/Vue.class index fcbc1cf..5dee8fb 100644 Binary files a/DEV.3.1/TP/TP3/ex1/Vue.class and b/DEV.3.1/TP/TP3/ex1/Vue.class differ diff --git a/DEV.3.1/TP/TP3/ex1/Vue.java b/DEV.3.1/TP/TP3/ex1/Vue.java index 5efc009..46f1116 100644 --- a/DEV.3.1/TP/TP3/ex1/Vue.java +++ b/DEV.3.1/TP/TP3/ex1/Vue.java @@ -60,7 +60,7 @@ public class Vue extends JFrame { this.add(this.trois, contrainte3); -// Contrainte du bouton 3 en bas à gauche +// Contrainte du bouton 4 en bas à gauche GridBagConstraints contrainte4 = new GridBagConstraints(); contrainte4.gridx = 0; contrainte4.gridy = 1; @@ -81,8 +81,8 @@ public class Vue extends JFrame { contrainte5.gridheight = 1; contrainte5.fill = GridBagConstraints.BOTH; contrainte5.anchor = GridBagConstraints.CENTER; - contrainte5.weightx = 1.0; - contrainte5.weighty = 1.0; + contrainte5.weightx = 0.0; + contrainte5.weighty = 0.0; this.add(this.cinq, contrainte5);