for(int i =0; i<8;i++){
for(int j =0; j<8;j++){
Ratsuk.getNewtablero().getMesa(i,j).setBackground(matrizcolor[i][j]);
if (Ratsuk.getNewtablero().getMesa(i,j).getBackground()==Color.lightGray);
Ratsuk.getNewtablero().getMesa(i,j).setEnabled(false);
}
}
Ratsuk.getNewtablero().getMesa(i,j)
newtablero 内にある JButton 2d 配列を呼び出すためのもので、matrizcolor は同じサイズの色の 2d 配列です。
これを実行すると、ライトグレーのボタンだけでなく、その配列のすべてのボタンが無効になります。なぜ私に説明できますか?