私はいくつかのコードの長さに変更する方法に取り組んでいました。
私はこれを持っていました:
rects[1].setLocation(0, 0);
rects[2].setLocation(100, 0);
rects[3].setLocation(200, 0);
rects[4].setLocation(300, 0);
rects[5].setLocation(400, 0);
rects[6].setLocation(500, 0);
rects[7].setLocation(0, 50);
rects[8].setLocation(100, 50);
rects[9].setLocation(200, 50);
rects[10].setLocation(300, 50);
rects[11].setLocation(400, 50);
rects[12].setLocation(500, 50);
rects[13].setLocation(0, 100);
rects[14].setLocation(100, 100);
rects[15].setLocation(200, 100);
rects[16].setLocation(300, 100);
rects[17].setLocation(400, 100);
rects[18].setLocation(500, 100);
rects[19].setLocation(0, 150);
rects[20].setLocation(100, 150);
rects[21].setLocation(200, 150);
rects[22].setLocation(300, 150);
rects[23].setLocation(400, 150);
rects[24].setLocation(500, 150);
そして私はそれをこれに変更しました:
for(int i = 1; i < 25; i++)
{
for(int j = 0; j < 550; j +=50)
{
for(int k = 0; k < 550; k +=50)
{
rects[i].setLocation(j, k);
}
}
}
問題は、後者は機能するはずですが、機能しないことです。私の質問は、何が問題なのかということです。問題を解決するために多くの方法を試しましたが、何も機能しません。問題が何であるかわからないので、私はこの質問をグーグルで検索する方法が必要です。注目に値する場合、これもアプレットからのコードです。