This commit is contained in:
2023-10-23 13:23:36 +02:00
parent 667dae6f1a
commit 322b22f9bf
5711 changed files with 72953 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,31 @@
import javax.swing.JComponent;
import java.awt.*;
public class Dessin extends JComponent {
public Dessin(){
}
@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.setColor(Color.BLUE);
secondPinceau.drawRect(20,20, 50, 50);
secondPinceau.setColor(Color.GREEN);
secondPinceau.fillOval(80, 20, 50, 50);
secondPinceau.setColor(Color.MAGENTA);
Font myFont = new Font("Arial", Font.BOLD, 14);
secondPinceau.setFont(myFont);
secondPinceau.drawString(">o<",140, 20);
Image cercles = Toolkit.getDefaultToolkit().getImage("cercles.png");
secondPinceau.drawImage(cercles,200,20,this);
}
}

View File

@@ -0,0 +1,22 @@
import javax.swing.JComponent;
import java.awt.Graphics;
public class Bonjour extends JComponent {
@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.setColor(new Color.BLUE);
secondPinceau.drawRect(20,20, 50, 50);
secondPinceau.setColor(new Color.GREEN);
secondPinceau.fillOval(80, 20, 50, 50);
secondPinceau.setColor(new Color.BLACK);
secondPinceau.drawString(140, 20, 50, 50)
}
}

Binary file not shown.

View File

@@ -0,0 +1,16 @@
import javax.swing.*;
import java.awt.*;
public class Q1_Formes{
public static void main(String[] args){
JFrame fenetre = new JFrame();
fenetre.setSize(500, 300);
fenetre.setLocation(0, 0);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Dessin lesDessins = new Dessin();
fenetre.add(lesDessins);
fenetre.setVisible(true);
}
}

View File

@@ -0,0 +1,19 @@
import javax.swing.*;
import java.awt.*;
public class Q1_Formes{
public static void main(String[] args){
JFrame fenetre = new JFrame();
fenetre.setSize(500, 300);
fenetre.setLocation(0, 0);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fenetre.setVisible(true);
JPanel carre = new JPanel();
JPanel disque = new JPanel();
JPanel texte = new JPanel();
}
@Override
protected void paintComponent(Graphics pinceau)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB