问题描述
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. c++ - 二维数组指针double **&field经过这个转换 (void*&) field 是什么意思?4. c++ - ACM问题,,高手进!!5. c++ - 数组声明在main函数中运行时栈溢出?6. c++ - 如何将静态库转成动态库(Visual Studio)?7. c++ 公有继承中,私有成员只能通过基类接口访问,如果我把派生类强制转换为基类,是否能访问其基类私有成员8. c++ - 为何这段数组比较的函数返回值不变?9. docker hub 的 URL 设计是什么意思?10. c++ - windows操作系统的有些疑惑。

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