This commit is contained in:
Simoes Lukas
2025-03-11 10:02:42 +01:00
parent 9441c8978a
commit 2a0aa37baa
47 changed files with 561 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
import java.awt.Point;
import java.awt.*;
import javax.swing.*;
public class Etoile implements ProducteurDePoints {
public class Etoile implements ProducteurDePoints extends JComponent {
private static final int xCentre = 100;
private static final int yCentre = 100;
private static final double rayon = 90.0;
@@ -24,7 +25,22 @@ public class Etoile implements ProducteurDePoints {
return p;
}
@Override
public void paintComponent(Graphics pinceau) {
Graphics secondPinceau = pinceau.create();
if (this.isOpaque()) {
secondPinceau.setColor(this.getBackground());
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
}
secondPinceau.drawRect();
}
public static void main(String[] args) {
JFrame fenetre = new JFrame();
fenetre.setSize(300, 300);
fenetre.setLocation(100, 100);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fenetre.setVisible(true);
Etoile e = new Etoile();
while (e.suivant() != null) {
// TODO

View File

@@ -1,5 +1,4 @@
public interface Vehicule {
public String sorte();
public int nbRoues();