问题描述
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]);
}
}
问题解答
回答1:第二个循环j打成i了,死循环
问题描述
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]);
}
}
问题解答
回答1:第二个循环j打成i了,死循环相关文章:1. C++中,有没有将路径字符串“D:\a\b\cc\..\..”转化为字符串“D:\a”这种功能的函数?2. c++ - 保存变量的地址3. c++ - 这段代码真的神了4. c++ - 在window下配置opengl的assimp数据库,使用cmake编译assimp时总是显示无法找到zlib,该怎么办?5. c++ - qt一般如何读写文件6. c++ - 运算符重载,先重载加后重载减,减的操作不正确7. c++ - 关于 throw 和拷贝构造8. c++ - C语言 关于b=a+++a++运算问题?9. c++的列表初始化10. c++ - cocos3.8 打包安卓时报错 各位大大求围观

网公网安备:皖ICP备2020019022号-8 Copyright ¢ 2020-2025 Powered by V1.8 All Rights Reserved 技术支持:乐呵呵网
声明:本站所有资源以学习为主