问题描述
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. javascript - type="date"的默认值能改变为当天日期吗2. 为什么矛那里的 <a href=" " 这地方为什么是空的呢 ??3. html5 - 有可以一次性把所有 css外部样式转为html标签内style=" "的方法吗?4. <tr valign="top"> 看不懂5. mysql - sphinx查询 "中国" 时也能查询到 "中华人民共和国"6. MySQL"="自动 like7. javascript - 在移动端input type="number" 键盘没法弹起8. mysql 使用 join 还是 "," 进行多表查询???9. solaris基础和常用知识 (2)10. 发现 <li><a href="/index.php">回到前台</a></li>这样回到首页后,不是登录状态
网公网安备:皖ICP备2020019022号-8 Copyright ¢ 2020-2025 Powered by V1.8 All Rights Reserved 技术支持:乐呵呵网
声明:本站所有资源以学习为主