问题描述
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 - 关于input="file",重复选择同一文件时不触发change事件的问题2. background-image:url(" ")我的图片在桌面3. 为什么总是提示我说Template "movieTemplate" not found,我路径都引对了呀4. <tr valign="top"> 看不懂5. javascript - var x = "[{’a’:’xx’},{’b’:’xxx’}]";如何在js中解析成json对象6. html5 - 有可以一次性把所有 css外部样式转为html标签内style=" "的方法吗?7. javascript - 一个字符串转换成数字,例子就是a="2,322.222",b=’1,211.21’,如何在angualr中执行相减8. mysql - 使用hibernate连接数据库时,数据库版本过高不支持关键字"type" ;9. 发现 <li><a href="/index.php">回到前台</a></li>这样回到首页后,不是登录状态10. javascript - body下多出了"1"==$0导致页面上多了1
网公网安备:皖ICP备2020019022号-8 Copyright ¢ 2020-2025 Powered by V1.8 All Rights Reserved 技术支持:乐呵呵网
声明:本站所有资源以学习为主