diff --git a/DEV.2.1/TP/TP1-introduction/Grille.class b/DEV.2.1/TP/TP1-introduction/Grille.class deleted file mode 100644 index a55d833..0000000 Binary files a/DEV.2.1/TP/TP1-introduction/Grille.class and /dev/null differ diff --git a/DEV.2.1/TP/TP1-introduction/Tri.class b/DEV.2.1/TP/TP1-introduction/Tri.class deleted file mode 100644 index 28aa04e..0000000 Binary files a/DEV.2.1/TP/TP1-introduction/Tri.class and /dev/null differ diff --git a/DEV.2.1/TP/TP6-Dessin/1.Formes/Formes.class b/DEV.2.1/TP/TP6-Dessin/1.Formes/Formes.class new file mode 100644 index 0000000..a04d024 Binary files /dev/null and b/DEV.2.1/TP/TP6-Dessin/1.Formes/Formes.class differ diff --git a/DEV.2.1/TP/TP6-Dessin/Formes.java b/DEV.2.1/TP/TP6-Dessin/1.Formes/Formes.java similarity index 51% rename from DEV.2.1/TP/TP6-Dessin/Formes.java rename to DEV.2.1/TP/TP6-Dessin/1.Formes/Formes.java index 0fe70b4..ae43991 100644 --- a/DEV.2.1/TP/TP6-Dessin/Formes.java +++ b/DEV.2.1/TP/TP6-Dessin/1.Formes/Formes.java @@ -13,20 +13,19 @@ public class Formes extends JComponent { protected void paintComponent(Graphics pinceau) { Graphics secondPinceau = pinceau.create(); - secondPinceau.setColor(this.getForeground()); - secondPinceau.drawString("Bonjour !", 10, 20); - } - public static void main(String[] args) { - JFrame frame = new JFrame("Formes"); - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - /* - Formes truc = new Formes(); - frame.add(truc); - */ - frame.setSize(500,500); - frame.setLocation(500,250); - frame.setVisible(true); - } + Font fonte = new Font("TimesRoman", Font.BOLD,24); + secondPinceau.setColor(new Color(128,0,128)); + secondPinceau.setFont(fonte); + secondPinceau.drawString(">o<", 10, 20); + + secondPinceau.setColor(Color.BLUE); + secondPinceau.drawRect(70,10,50,50); + + secondPinceau.setColor(Color.GREEN); + secondPinceau.drawOval(140,10,25,25); + + + } } \ No newline at end of file diff --git a/DEV.2.1/TP/TP6-Dessin/1.Formes/MainFormes.class b/DEV.2.1/TP/TP6-Dessin/1.Formes/MainFormes.class new file mode 100644 index 0000000..52a9089 Binary files /dev/null and b/DEV.2.1/TP/TP6-Dessin/1.Formes/MainFormes.class differ diff --git a/DEV.2.1/TP/TP6-Dessin/1.Formes/MainFormes.java b/DEV.2.1/TP/TP6-Dessin/1.Formes/MainFormes.java new file mode 100644 index 0000000..786f663 --- /dev/null +++ b/DEV.2.1/TP/TP6-Dessin/1.Formes/MainFormes.java @@ -0,0 +1,16 @@ +import javax.swing.*; +import java.awt.*; + +public class MainFormes{ + public static void main(String[] args){ + JFrame frame = new JFrame("Formes"); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + Formes truc = new Formes(); + frame.add(truc); + + frame.setSize(500,500); + frame.setLocation(500,250); + frame.setVisible(true); + } +} \ No newline at end of file diff --git a/DEV.2.1/TP/TP6-Dessin/img.png b/DEV.2.1/TP/TP6-Dessin/1.Formes/img.png similarity index 100% rename from DEV.2.1/TP/TP6-Dessin/img.png rename to DEV.2.1/TP/TP6-Dessin/1.Formes/img.png diff --git a/DEV.2.1/TP/TP6-Dessin/Bonjour.class b/DEV.2.1/TP/TP6-Dessin/Bonjour.class deleted file mode 100644 index 12b031c..0000000 Binary files a/DEV.2.1/TP/TP6-Dessin/Bonjour.class and /dev/null differ diff --git a/DEV.2.1/TP/TP6-Dessin/Bonjour.java b/DEV.2.1/TP/TP6-Dessin/Bonjour.java deleted file mode 100644 index 95425eb..0000000 --- a/DEV.2.1/TP/TP6-Dessin/Bonjour.java +++ /dev/null @@ -1,22 +0,0 @@ - - -import javax.swing.JComponent; -import java.awt.*; - -public class Bonjour extends JComponent { - private Image pingouin; - public Bonjour() { - super(); - this.pingouin = Toolkit.getDefaultToolkit().getImage("walk-0.png"); - } - @Override - protected void paintComponent(Graphics pinceau) { - Graphics secondPinceau = pinceau.create(); - if (this.isOpaque()) { - secondPinceau.setColor(this.getBackground()); - secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); - } - - secondPinceau.drawImage(this.pingouin, 10, 20, this); - } -} \ No newline at end of file