diff --git a/BUT1/DEV2.1/TD/Td.java b/BUT1/DEV2.1/TD/Td.java index af1d874..8e570f6 100644 --- a/BUT1/DEV2.1/TD/Td.java +++ b/BUT1/DEV2.1/TD/Td.java @@ -18,4 +18,9 @@ public class Exemple{ System.out.println(f); } } +} + +public class Controleur extends MouseAdapter +implements MouseMotionListener, ActionListener{ + ... } \ No newline at end of file diff --git a/BUT1/DEV2.1/TP2-ComposantsGraphique/EXO4/exo4.java b/BUT1/DEV2.1/TP2-ComposantsGraphique/EXO4/exo4.java index 52b7ec9..7947ca6 100644 --- a/BUT1/DEV2.1/TP2-ComposantsGraphique/EXO4/exo4.java +++ b/BUT1/DEV2.1/TP2-ComposantsGraphique/EXO4/exo4.java @@ -7,7 +7,7 @@ public class exo4 { JFrame fenetre = new JFrame(); // on configure la fenetre - fenetre.setPreferredSize(1200, 1000); + fenetre.setSize(1200, 1000); fenetre.setLocation(100, 100); fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); diff --git a/BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Moto.class b/BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Moto.class new file mode 100644 index 0000000..fcdbc80 Binary files /dev/null and b/BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Moto.class differ diff --git a/BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Test.class b/BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Test.class new file mode 100644 index 0000000..f97ec0a Binary files /dev/null and b/BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Test.class differ diff --git a/BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Vehicule.class b/BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Vehicule.class new file mode 100644 index 0000000..ac7eaa1 Binary files /dev/null and b/BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Vehicule.class differ diff --git a/BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Voiture.class b/BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Voiture.class new file mode 100644 index 0000000..c6cc2b9 Binary files /dev/null and b/BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Voiture.class differ diff --git a/BUT1/DEV2.1/TP8-Évènements/EXO2/Attente$1.class b/BUT1/DEV2.1/TP8-Évènements/EXO2/Attente$1.class new file mode 100644 index 0000000..b686f95 Binary files /dev/null and b/BUT1/DEV2.1/TP8-Évènements/EXO2/Attente$1.class differ diff --git a/BUT1/DEV2.1/TP8-Évènements/EXO2/Attente$2.class b/BUT1/DEV2.1/TP8-Évènements/EXO2/Attente$2.class new file mode 100644 index 0000000..8829296 Binary files /dev/null and b/BUT1/DEV2.1/TP8-Évènements/EXO2/Attente$2.class differ diff --git a/BUT1/DEV2.1/TP8-Évènements/EXO2/Attente.class b/BUT1/DEV2.1/TP8-Évènements/EXO2/Attente.class new file mode 100644 index 0000000..0ef13dd Binary files /dev/null and b/BUT1/DEV2.1/TP8-Évènements/EXO2/Attente.class differ diff --git a/BUT1/DEV2.1/TP8-Évènements/EXO2/Attente.java b/BUT1/DEV2.1/TP8-Évènements/EXO2/Attente.java index 7700e9c..2a34da7 100644 --- a/BUT1/DEV2.1/TP8-Évènements/EXO2/Attente.java +++ b/BUT1/DEV2.1/TP8-Évènements/EXO2/Attente.java @@ -1,28 +1 @@ -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -public class Fond Attente ActionListener { - static JPanel panneau; - - public static void main(String[] args) { - JFrame fenetre = new JFrame("Fond"); - fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - fenetre.setSize(500, 500); - JPanel panneau = new JPanel(); - fenetre.add(panneau); - - fenetre.setVisible(true); - } -} - - -try { - int n = Integer.parseInt(args[0]); - System.out.println("En hexadecimal" + Integer.toHexString(n)); -}catch(NumberFormatException e){ - System.err.println("Ceci n'est pas un" + "entier !"); -} catch(ArrayIndexOutOfBoundsException e){ - System.err.println("Il faut un argument :"); -} \ No newline at end of file +// A faire \ No newline at end of file diff --git a/BUT1/DEV2.1/TP8-Évènements/EXO2/Dessin.class b/BUT1/DEV2.1/TP8-Évènements/EXO2/Dessin.class new file mode 100644 index 0000000..8686ea3 Binary files /dev/null and b/BUT1/DEV2.1/TP8-Évènements/EXO2/Dessin.class differ diff --git a/BUT1/DEV2.1/TP8-Évènements/EXO2/Dessin.java b/BUT1/DEV2.1/TP8-Évènements/EXO2/Dessin.java new file mode 100644 index 0000000..e4bab9d --- /dev/null +++ b/BUT1/DEV2.1/TP8-Évènements/EXO2/Dessin.java @@ -0,0 +1,26 @@ +import javax.swing.*; +import java.awt.*; + +public class Dessin extends JComponent { + + private Image imageDeCercle; + public Dessin() { + super(); + } + // Méthode pour dessiner sur le composant + @Override + protected void paintComponent(Graphics pinceau) { + // Obligatoire : on crée un nouveau pinceau pour pouvoir le modifier plus tard + Graphics secondPinceau = pinceau.create(); + + // Obligatoire : si le composant n'est pas censé être transparent + if (this.isOpaque()) { + // Obligatoire : on repeint toute la surface avec la couleur de fond + secondPinceau.setColor(this.getBackground()); + secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); + } + + secondPinceau.setColor(new Color(30,255,30)); + secondPinceau.fillArc(20, 95, 50, 50, 0, 360); +} +} \ No newline at end of file diff --git a/BUT1/DEV2.1/TP8-Évènements/EXO2/Disque.class b/BUT1/DEV2.1/TP8-Évènements/EXO2/Disque.class new file mode 100644 index 0000000..97178cc Binary files /dev/null and b/BUT1/DEV2.1/TP8-Évènements/EXO2/Disque.class differ diff --git a/BUT1/DEV2.1/TP8-Évènements/EXO2/Disque.java b/BUT1/DEV2.1/TP8-Évènements/EXO2/Disque.java new file mode 100644 index 0000000..f66bdd0 --- /dev/null +++ b/BUT1/DEV2.1/TP8-Évènements/EXO2/Disque.java @@ -0,0 +1,12 @@ +import javax.swing.*; +import java.awt.*; + +public class Disque extends Dessin { + public Disque(){ + // Maintenant on dessine ce que l'on veut + super(); + Graphics secondPinceau = getGraphics(); + secondPinceau.setColor(new Color(30,255,30)); + secondPinceau.fillArc(20, 95, 50, 50, 0, 360); + } +}