This commit is contained in:
2023-04-04 14:03:16 +02:00
parent 7021891e9c
commit e32d4de827
111 changed files with 1928 additions and 6 deletions

Binary file not shown.

View File

@@ -0,0 +1,27 @@
import javax.swing.*;
import java.awt.*;
public class Carre extends JComponent{
private Image pingouin;
public Carre(){
super();
this.pingouin = Toolkit.getDefaultToolkit().getImage("cercles.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.setColor(Color.BLUE);
secondPinceau.drawRect(150,200,50,50);
secondPinceau.setColor(Color.GREEN);
secondPinceau.drawOval(100,100,25,25);
secondPinceau.drawImage(this.pingouin, 150, 125, this);
secondPinceau.drawString("Bonjour !", 300, 180);
}
}

Binary file not shown.

View File

@@ -0,0 +1,21 @@
import javax.swing.*;
import java.awt.*;
public class Formes{
public static void main(String[] args) {
JFrame fenetre = new JFrame();
fenetre.setSize(1920, 1080);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
GridLayout orga = new GridLayout(2,2);
fenetre.setLayout(orga);
Carre lesformes = new Carre();
fenetre.add(lesformes, BorderLayout.CENTER);
fenetre.setVisible(true);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB