update
This commit is contained in:
@@ -3,14 +3,10 @@ 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();
|
||||
public Declinaisons(String form, String fond) {
|
||||
if(inst % 2 == 0) {
|
||||
secondPinceau.setColor("")
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -21,10 +17,19 @@ public class Declinaisons extends JComponent {
|
||||
secondPinceau.setColor(this.getBackground());
|
||||
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||
}
|
||||
|
||||
secondPinceau.setColor(this.getForeground());
|
||||
|
||||
|
||||
for(int i=0; i<10; i++){
|
||||
if(this.num % 2 == 0){
|
||||
this.num ++;
|
||||
secondPinceau.setColor(Color.MAGENTA);
|
||||
} else {
|
||||
secondPinceau.setColor(Color.CYAN);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
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);
|
||||
|
@@ -9,8 +9,10 @@ public class Main {
|
||||
GridLayout tabl = new GridLayout(2,2);
|
||||
fenetre.setLayout(tabl);
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
for(int i = 0; i < 4; i++){
|
||||
fenetre.add(new Declinaisons());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user