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,25 @@
import javax.swing.JComponent;
import java.awt.*;
public class Cercle extends JComponent {
public Color couleurCercle;
public Cercle(int r, int g, int b){
this.couleurCercle = new Color(r,g,b);
}
@Override
protected void paintComponent(Graphics pinceau) {
Graphics secondPinceau = pinceau.create();
Color couleurFond = this.getBackground();
if (this.isOpaque()) {
secondPinceau.setColor(couleurFond);
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
}
secondPinceau.setColor(this.couleurCercle);
secondPinceau.fillOval(0,0, this.getWidth(), this.getHeight());
secondPinceau.setColor(couleurFond);
secondPinceau.fillOval(this.getWidth()/4 , this.getHeight()/4 , this.getWidth()/2 , this.getHeight()/2);
}
}

View File

@@ -0,0 +1,25 @@
import javax.swing.JComponent;
import java.awt.*;
public class Cercle extends JComponent {
public Color couleurCercle;
public Cercle(int r, int g, int b){
this.couleurCercle = new Color(r,g,b);
}
@Override
protected void paintComponent(Graphics pinceau) {
Graphics secondPinceau = pinceau.create();
Color couleurFond = this.getBackground()
if (this.isOpaque()) {
secondPinceau.setColor(couleurFond);
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
}
secondPinceau.setColor(this.couleurCercle);
secondPinceau.fillOval(0,0, this.getWidth(), this.getHeight());
secondPinceau.setColor(couleurFond);
secondPinceau.fillOval(this.getWidth()/4 , this.getHeight()/4 , 3*this.getWidth()/4 , 3*this.getHeight()/4);
}
}

Binary file not shown.

View File

@@ -0,0 +1,28 @@
import javax.swing.*;
import java.awt.*;
public class Q4Main{
public static void main(String[] args){
JFrame fenetre = new JFrame();
fenetre.setSize(500, 300);
fenetre.setLocation(0, 0);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GridLayout grille = new GridLayout(5,5);
fenetre.setLayout(grille);
Cercle[][] tabCercle = new Cercle[5][5];
int vert = 0;
for (Cercle[] ligne : tabCercle){
int bleu = 25;
vert += 50;
for (Cercle cercle : ligne){
cercle = new Cercle(0,vert,bleu);
fenetre.add(cercle);
bleu += 50;
}
}
fenetre.setVisible(true);
}
}

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);
Cercle[][] listeCercle = new Cercle[25];
fenetre.add(lesDessins);
fenetre.setVisible(true);
}
}