问题描述
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++ - 在main函数执行之前段错误,gdb无法调试,估计和g++编译参数相关。2. CentOS7 启动docker.service失败3. 1LL在C++中是什么意思?4. c++ - extern int a=1为什么在函数内部报错?5. c++ - cocos3.8 打包安卓时报错 各位大大求围观6. c++ - 保存变量的地址7. c++ 公有继承中,私有成员只能通过基类接口访问,如果我把派生类强制转换为基类,是否能访问其基类私有成员8. c++ - 为何这段数组比较的函数返回值不变?9. c++ - windows操作系统的有些疑惑。10. docker hub 的 URL 设计是什么意思?

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