Heim  >  Fragen und Antworten  >  Hauptteil

Warum ist mein Zellenarray im Abseits?

for(int i = 0;i<4;i++) {//行数

for(int j = 0;i<3;j++) {//列数

ImageIcon icon = new ImageIcon("图片\ 1_"+(i*3+j+1)+".gif");

cell[i*3+j] = new Cell(icon);

cell[i*3+j].setLocation(j *150+20, i*150+20);

this.add(cell[i*3+j]);

}

}


2300 Tage vor1222

Antworte allen(1)Ich werde antworten

  • 2018-07-02 08:43:14

    第二个循环j打成i了,死循环

    Antwort
    0
  • StornierenAntwort