SAE21_2021/Etoile.java

13 lines
361 B
Java
Raw Normal View History

2022-04-26 10:42:13 +02:00
import javax.swing.JComponent;
import java.awt.*;
public class Etoile extends JComponent {
@Override
protected void paintComponent(Graphics pinceau) {
Graphics etoile = pinceau.create();
2022-04-26 12:15:13 +02:00
int[] x={0,35,50,65,100,70,90,50,20,35};
2022-04-26 10:42:13 +02:00
int[] y={40,40,0,40,40,60,100,80,100,80};
etoile.setColor(Color.MAGENTA);
etoile.fillPolygon(x,y,10);
}
}