SAE21_2021/Case.java

33 lines
926 B
Java
Raw Normal View History

2022-04-27 16:16:34 +02:00
/*public class Case {
// Réalisation du damier et ajout d'éléments graphiques
for (int currentLine=0; currentLine<lignes; currentLine++){
for(int currentCase = 0; currentCase < colonnes; currentCase++){
if (currentLine%2==0){
if (currentCase%2==0){
JPanel dark = new JPanel();
dark.setSize(caseSize);
dark.setBackground(gray2);
grille.add(dark);
} else {
JPanel light = new JPanel();
light.setSize(caseSize);
light.setBackground(gray1);
grille.add(light);
}
} else {
if (currentCase%2==0){
JPanel light = new JPanel();
light.setSize(caseSize);
light.setBackground(gray1);
grille.add(light);
} else {
JPanel dark = new JPanel();
dark.setSize(caseSize);
dark.setBackground(gray2);
grille.add(dark);
}
}
}
}
}*/