Files
DEV/DEV.2.1/CM-blanc/CM-1/3.Declinaisons/Declinaisons.java
Emmanuel Srivastava 832fe9f240 update
2025-03-17 14:53:58 +01:00

33 lines
884 B
Java

import javax.swing.*;
import java.awt.*;
public class Declinaisons extends JComponent {
private Color cyan = Color.CYAN;
private Color pink = Color.PINK;
private Color magenta = Color.MAGENTA;
private Color yellow = Color.YELLOW;
private Color blue = Color.BLUE;
public Declinaisons() {
super();
}
@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(this.getForeground());
int[] Xpoints = {this.getWidth()/4, this.getWidth()/4*3, this.getWidth()/2};
int[] Ypoints = {this.getHeight()/2, this.getHeight()/4, this.getHeight()/4*3};
secondPinceau.fillPolygon(Xpoints, Ypoints, 3);
}
}