1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| public void afficher(String[][] plat, int i , int j){
if(plat[j][i].equals(charJ1)){
for(int x = 5; x>j-1;x--){
try {
plateau[x][i].setIcon(new ImageIcon(imageJ1));
Thread.sleep(800);
plateau[x][j].setIcon(new ImageIcon(imageVide));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
plateau[i][j].setIcon(new ImageIcon(imageJ1));
} else if (plat[j][i].equals(charJ2)){
for(int x = 0; x>j-1;x--){
try {
plateau[x][i].setIcon(new ImageIcon(imageJ2));
Thread.sleep(800);
plateau[x][j].setIcon(new ImageIcon(imageVide));
} catch (InterruptedException e) {
e.printStackTrace();
}
}
plateau[i][j].setIcon(new ImageIcon(imageJ2));
}
} |
Partager