From 70336db647c176a493be67a4e4576382dc568705 Mon Sep 17 00:00:00 2001 From: Emmanuel Srivastava Date: Wed, 5 Mar 2025 21:36:58 +0100 Subject: [PATCH] update --- .../1.Fond/.nfs0000000000e4b93f00000006 | 37 +++++++++ .../1.Fond/.nfs0000000000e4d56600000007 | 72 ++++++++++++++++++ .../TP/TP8-Evenements/3.Radio/MainRadio.class | Bin 0 -> 609 bytes .../TP/TP8-Evenements/3.Radio/MainRadio.java | 17 +++++ DEV.2.1/TP/TP8-Evenements/3.Radio/Radio.java | 39 ++++++++++ 5 files changed, 165 insertions(+) create mode 100644 DEV.2.1/TP/TP8-Evenements/1.Fond/.nfs0000000000e4b93f00000006 create mode 100644 DEV.2.1/TP/TP8-Evenements/1.Fond/.nfs0000000000e4d56600000007 create mode 100644 DEV.2.1/TP/TP8-Evenements/3.Radio/MainRadio.class create mode 100644 DEV.2.1/TP/TP8-Evenements/3.Radio/MainRadio.java create mode 100644 DEV.2.1/TP/TP8-Evenements/3.Radio/Radio.java diff --git a/DEV.2.1/TP/TP8-Evenements/1.Fond/.nfs0000000000e4b93f00000006 b/DEV.2.1/TP/TP8-Evenements/1.Fond/.nfs0000000000e4b93f00000006 new file mode 100644 index 0000000..b33bebe --- /dev/null +++ b/DEV.2.1/TP/TP8-Evenements/1.Fond/.nfs0000000000e4b93f00000006 @@ -0,0 +1,37 @@ +import java.awt.*; +import javax.swing.*; + +public class Fond extends JPanel implements ActionListener { + private JButton Cyan, Magenta, Jaune; + + public Fond() { + this.setLayout(null); + + this.Cyan = new JButton("Cyan"); + this.Magenta = new JButton("Magenta"); + this.Jaune = new JButton("Jaune"); + + this.Cyan.setBounds(100,50,100,20); + this.Magenta.setBounds(220,50,100,20); + this.Jaune.setBounds(320,50,100,20); + + this.Cyan.addActionListener(this); + this.Magenta.addActionListener(this); + this.Jaune.addActionListener(this); + + this.add(this.Cyan); + this.add(this.Magenta); + this.add(this.Jaune); + } + + @Override + public void actionPerformed(ActionEvent evenement) { + if (evenement.getSource() == this.Cyan) { + this.setBackground(Color.CYAN); + } else if (evenement.getSource() == this.Magenta) { + this.setBackground(Color.MAGENTA); + } else if (evenement.getSource() == this.Jaune) { + this.setBackground(Color.YELLOW); + } + } +} \ No newline at end of file diff --git a/DEV.2.1/TP/TP8-Evenements/1.Fond/.nfs0000000000e4d56600000007 b/DEV.2.1/TP/TP8-Evenements/1.Fond/.nfs0000000000e4d56600000007 new file mode 100644 index 0000000..29a9a37 --- /dev/null +++ b/DEV.2.1/TP/TP8-Evenements/1.Fond/.nfs0000000000e4d56600000007 @@ -0,0 +1,72 @@ +import javax.swing.*; +import java.awt.*; + +public class MainFond { + public static void main(String[] args) { + JFrame frame = new JFrame("Fond"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + + Fond panel = new Fond(); + + frame.add(panel); + frame.setSize(500,500); + frame.setLocation(500,250); + frame.setVisible(true); + } +} + + +./Fond.java:4: error: cannot find symbol +public class Fond extends JPanel implements ActionListener { + ^ + symbol: class ActionListener +./Fond.java:27: error: cannot find symbol + public void actionPerformed(ActionEvent evenement) { + ^ + symbol: class ActionEvent + location: class Fond +./Fond.java:17: error: incompatible types: Fond cannot be converted to ActionListener + this.Cyan.addActionListener(this); + ^ +./Fond.java:18: error: incompatible types: Fond cannot be converted to ActionListener + this.Magenta.addActionListener(this); + ^ +./Fond.java:19: error: incompatible types: Fond cannot be converted to ActionListener + this.Jaune.addActionListener(this); + ^ +./Fond.java:26: error: method does not override or implement a method from a supertype + @Override + ^ +./Fond.java:33: error: cannot find symbol + setBackground(Color.JAUNE); + ^ + symbol: variable JAUNE + location: class Color +Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output +7 errors +[srivasta@vm-srivasta 1.Fond]$ q +[srivasta@vm-srivasta 1.Fond]$ javac MainFond.java +./Fond.java:4: error: cannot find symbol +public class Fond extends JPanel implements ActionListener { + ^ + symbol: class ActionListener +./Fond.java:28: error: cannot find symbol + public void actionPerformed(ActionEvent evenement) { + ^ + symbol: class ActionEvent + location: class Fond +./Fond.java:18: error: incompatible types: Fond cannot be converted to ActionListener + this.Cyan.addActionListener(this); + ^ +./Fond.java:19: error: incompatible types: Fond cannot be converted to ActionListener + this.Magenta.addActionListener(this); + ^ +./Fond.java:20: error: incompatible types: Fond cannot be converted to ActionListener + this.Jaune.addActionListener(this); + ^ +./Fond.java:27: error: method does not override or implement a method from a supertype + @Override + ^ +Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output +6 errors diff --git a/DEV.2.1/TP/TP8-Evenements/3.Radio/MainRadio.class b/DEV.2.1/TP/TP8-Evenements/3.Radio/MainRadio.class new file mode 100644 index 0000000000000000000000000000000000000000..3587d8b90cf7fbbfd93e004c4532ec5bec522771 GIT binary patch literal 609 zcmX^0Z`VEs1_mbvZ7v2T24;2!79Ivx1~x_pfvm)`ME#t^ymWp4q^#8B5=I6#o6Nk- z5<5l)W)00Sb_Nbc1|g853jN~p%)E4cFSnw^+*A$*E=C5{pv08Sd@crd1|E=cyo?N@ z8a^Pk5CeltiZb)ktu@0yD)@OA1Q-Mv86=8ROI%XZ5=(PRoOAMvQ~e84ixNvR^Ya)P zSTsCA7IJYh2r)2&^oa5>h%tyWGB78mq%bmQLCsDqFVT0-&n?K$OU)~>)`VDyDhSdn z$-^MUAkE0YUYuGIoLQC1$iS-M=?QU+EDwVmNRGQWwZtbs8EijDj{*;aB7+hm16Ofs zNmyoaW>QWn$XQV!XQ?nUaQY@@=7Igp$iU*9pOVVR!0(fpm+DuVo0M74RIMbY~ew{$iNkxUs{x$>Xr#In-6ZH9w^)x6d9Bmm>58SiGdLmLkx@zstgPa zvJ8w2j0_A6tXkU{7&kI7FfcNxF)%Q&fdyF@I2qI#G@wee8JHQE85kJMcQdd@3UO{{ z;P%mG+s44Rn?WdYJA<&Vw$3&Nk#KE6#xH`5U$!wwfLRQ`wlT