This commit is contained in:
Emmanuel Srivastava
2025-02-13 15:30:47 +01:00
parent 1cf9b2ca57
commit 645cf79354
4 changed files with 31 additions and 12 deletions

View File

@@ -2,17 +2,23 @@ import javax.swing.*;
import java.awt.*;
public class Sautoir extends JComponent {
private Image img;
public Sautoir() {
super();
}
@Override
protected void paintComponent(Graphics pinceau) {
Graphics secondPinceau = pinceau.create();
secondPinceau.setColor(this.getForeground());
}
int col = 5;
int ligne = 5;
int caseWidth = getWidth() / col;
int caseHeight = getHeight() / ligne;
secondPinceau.setColor(Color.CYAN);
int[] xPoints = {0,caseWidth * col, 0, caseWidth * col};
int[] yPoints = {0,0,caseHeight * ligne, caseHeight * ligne};
secondPinceau.fillPolygon(xPoints, yPoints, 4);
}
}