From f389f98e24dfad425955913dd9bd180e5d1e406f Mon Sep 17 00:00:00 2001 From: EmmanuelTiamzon Date: Tue, 30 Sep 2025 11:15:03 +0200 Subject: [PATCH] update --- DEV.3.1/TP/TP3/ex1/Controleur.class | Bin 0 -> 523 bytes DEV.3.1/TP/TP3/ex1/Controleur.java | 19 ++++++ DEV.3.1/TP/TP3/ex1/Main.class | Bin 0 -> 312 bytes DEV.3.1/TP/TP3/ex1/Main.java | 6 ++ DEV.3.1/TP/TP3/ex1/Vue.class | Bin 0 -> 1767 bytes DEV.3.1/TP/TP3/ex1/Vue.java | 93 ++++++++++++++++++++++++++++ 6 files changed, 118 insertions(+) create mode 100644 DEV.3.1/TP/TP3/ex1/Controleur.class create mode 100644 DEV.3.1/TP/TP3/ex1/Controleur.java create mode 100644 DEV.3.1/TP/TP3/ex1/Main.class create mode 100644 DEV.3.1/TP/TP3/ex1/Main.java create mode 100644 DEV.3.1/TP/TP3/ex1/Vue.class create mode 100644 DEV.3.1/TP/TP3/ex1/Vue.java diff --git a/DEV.3.1/TP/TP3/ex1/Controleur.class b/DEV.3.1/TP/TP3/ex1/Controleur.class new file mode 100644 index 0000000000000000000000000000000000000000..33df858149261d850140c7f9793ad5fb06922507 GIT binary patch literal 523 zcmX^0Z`VEs1_pBmSuO@P27V3(0WJnX1|cp6VFnR)22pkfF-8V9o6Nk-5<5l)W)00S zMg|t={FGEi27aH+yi~u^+@#c^ki?{%R7M8g^31%H{Bq}<{Nl{KbVdew4WF#UvPAvF z@)G^jvedj1{cx}XR}kA8WE59$erZv1s#_*VJHK;&UP)1YPHJh99!MV#13Lo;BZJZ5 zu9DPZ-Lm}BVuj+vyNeW3QWeVbOLOuwixkpQi*i$o6p~X*N>UZlQu7Y4Dk(};uxDow z=V6dwkYs0&;$e_xkYQxtLYU3SAOkWT!&Qzci3KI8MT`vMAn6MI;_}SAbbT-Xf|AVq zynw{KR7M8D;*9)q=ls01%%WVE%*34hbVdeEBu_f$=N9DWrRJ4bLp+|7n3t~apOlrF zTw<;1$;co8GFcxi8eCailA6oNz>->#S;EM`qT#6-#-PZ+%D~0|0!$2yAm1}EGH^05 zFeoxGGB7eQFtBQEXJFjOz`(%Bz{SA8z{SACz`(%4z{0@Az{tSOzynpT!@vZV;b9bF o+QGma&b)(x1)+k literal 0 HcmV?d00001 diff --git a/DEV.3.1/TP/TP3/ex1/Controleur.java b/DEV.3.1/TP/TP3/ex1/Controleur.java new file mode 100644 index 0000000..be2ff7c --- /dev/null +++ b/DEV.3.1/TP/TP3/ex1/Controleur.java @@ -0,0 +1,19 @@ +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); + } + +} \ 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 new file mode 100644 index 0000000000000000000000000000000000000000..e9620cdb123c192818659c35c1bb08f8c02bbfdd GIT binary patch literal 312 zcmX^0Z`VEs1_pBmQ7#5{1_5>kK`sU+5G};TzyhL$*%?F_8Q5$x^D;~97#Wx~G{YDf zSe)}yQW+WeeKPY>{YrC_Qj0Y&Q()EK&iZb)k ztw9>Og7Zs@l2hF>L5ewj6EpMlKOM5JBapRXYk}=5M!_balF_Wytx=8K^#d2 zA5I2I244{22O|7IL;#2g1Q9_XA{b<22#5#;5n=2M;fxGSrFo1DqCQ!PWr-E~#pRiK z>H1zyr6nc#dDe^!EGem_6^sn5B}Ms}#f%JWg{6rlMX8JoEXkR9g^Ubb$@zIDMfo|Y zrA3SkJU-5Fo;4!_n@wh3W{Djm1G9!^7$XCVbAC!HBLlxrW?rgaX>L+#QAlD^PAVe< zS8#r5QF5wVCWylkR+_2@atb2@yHkE?Nq$~24}(5K1P?H5Z>fr&}GnLWRM0KifpfQeqM1& zQDSCZNih#YB0~}nLo$d+0THPnA`L{OgNO`>8V9vvslxMGE*uT85lho8NlpHMg~rhSb1hjNd_YW z7l@sanwg$a!pOjqmYI{o$iSAEmzsis8%payXf=&)>MkOgt&KrDG3uudJ2P7nds$*+UZ>8H!Gl|fpUbt{7mh>!(wlD;Q=(J*yWC6KXl7(d}gAACIm1JSv${+`3%S*C=4Ul93nE)oiMhHu? zAeq4`$qKR`Ov->sSuiOFCgmkrA!e|G%>a>LGejj>w=pP#0zqOMgNhc*HU`y=;OI1B zU|?ioaA06y;9_87;ARkD;9(GD;AN0v;Ac=}5M(f75Mr=r5N7aU5MhX95M@YX5MwB0 zkYuQ2kYcD~kY;FRkYVUxkY(s)kYkv{AkQ#^L4jc|gCfHs24#lT3~CIU8PpkeFlaFB zWzb|e#Gu7+oI#u641*5CB?euF>kN7fcNh#9o-!CSyk#(9_{3n!@SVYo;SYm3BO`+a zBO8MyBM*ZWqacGdqZorNqdbEHqXvT`qaK43qX~mEqZNY-qXUC0qZ@-8qc4LyV=#jU zVn8J9CeGOlNc QX57LM!@$U33{LhY02u*z*Z=?k literal 0 HcmV?d00001 diff --git a/DEV.3.1/TP/TP3/ex1/Vue.java b/DEV.3.1/TP/TP3/ex1/Vue.java new file mode 100644 index 0000000..5efc009 --- /dev/null +++ b/DEV.3.1/TP/TP3/ex1/Vue.java @@ -0,0 +1,93 @@ +import java.awt.*; +import javax.swing.*; + +public class Vue extends JFrame { + + private JButton un,deux,trois,quatre,cinq; + private Controleur controleur; + + public Vue() { + super("Boutons"); + this.setSize(500,500); + this.setLocationRelativeTo(null); + this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + + this.setLayout(new GridBagLayout()); + + this.un = new JButton("1"); + this.deux = new JButton("2"); + this.trois = new JButton("3"); + this.quatre = new JButton("4"); + this.cinq = new JButton("5"); + this.controleur = new Controleur(); + +// Contrainte du bouton 1 en haut à gauche + GridBagConstraints contrainte1 = new GridBagConstraints(); + contrainte1.gridx = 0; + contrainte1.gridy = 0; + contrainte1.gridwidth = 2; + contrainte1.gridheight = 1; + contrainte1.fill = GridBagConstraints.BOTH; + contrainte1.anchor = GridBagConstraints.CENTER; + contrainte1.weightx = 1.0; + contrainte1.weighty = 1.0; + + this.add(this.un, contrainte1); + +// Contrainte du bouton 2 en haut à droite + GridBagConstraints contrainte2 = new GridBagConstraints(); + contrainte2.gridx = 2; + contrainte2.gridy = 0; + contrainte2.gridwidth = 1; + contrainte2.gridheight = 2; + contrainte2.fill = GridBagConstraints.BOTH; + contrainte2.anchor = GridBagConstraints.CENTER; + contrainte2.weightx = 1.0; + contrainte2.weighty = 1.0; + + this.add(this.deux, contrainte2); + +// Contrainte du bouton 3 en bas à droite + GridBagConstraints contrainte3 = new GridBagConstraints(); + contrainte3.gridx = 1; + contrainte3.gridy = 2; + contrainte3.gridwidth = 2; + contrainte3.gridheight = 1; + contrainte3.fill = GridBagConstraints.BOTH; + contrainte3.anchor = GridBagConstraints.CENTER; + contrainte3.weightx = 1.0; + contrainte3.weighty = 1.0; + + this.add(this.trois, contrainte3); + +// Contrainte du bouton 3 en bas à gauche + GridBagConstraints contrainte4 = new GridBagConstraints(); + contrainte4.gridx = 0; + contrainte4.gridy = 1; + contrainte4.gridwidth = 1; + contrainte4.gridheight = 2; + contrainte4.fill = GridBagConstraints.BOTH; + contrainte4.anchor = GridBagConstraints.CENTER; + contrainte4.weightx = 1.0; + contrainte4.weighty = 1.0; + + this.add(this.quatre, contrainte4); + +// Contraite du bouton 5 au milieu + GridBagConstraints contrainte5 = new GridBagConstraints(); + contrainte5.gridx = 1; + contrainte5.gridy = 1; + contrainte5.gridwidth = 1; + contrainte5.gridheight = 1; + contrainte5.fill = GridBagConstraints.BOTH; + contrainte5.anchor = GridBagConstraints.CENTER; + contrainte5.weightx = 1.0; + contrainte5.weighty = 1.0; + + this.add(this.cinq, contrainte5); + + this.addWindowListener(this.controleur); + + this.setVisible(true); + } +} \ No newline at end of file