乐呵呵网
  • 首页index
  • 电脑知识pc
  • 手机知识mobile
  • 软件教程soft
  • 编程技术code
  • 生活常识life
  • 常见问答answer
  • 美食之家cate
  • 健身养生keep
  • 吃喝玩乐happy
您的位置:首页常见问答文章内容

为什么我的cell数组越位了

浏览:233日期:2022-10-26

问题描述

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了,死循环
上一条:老师,这个题我用这个做法,不是会员无法输出。请点评错在哪里了下一条:jspStudy 怎么更换JDK的版本?
相关文章:
1. javascript - 关于input="file",重复选择同一文件时不触发change事件的问题2. 为什么矛那里的 <a href=" " 这地方为什么是空的呢 ??3. 为什么总是提示我说Template "movieTemplate" not found,我路径都引对了呀4. <tr valign="top"> 看不懂5. solaris基础和常用知识 (2)6. MySQL"="自动 like7. node.js mysql Cannot find module "net" 和 "tls"和"fs" 的问题8. mysql 使用 join 还是 "," 进行多表查询???9. mysql - 使用hibernate连接数据库时,数据库版本过高不支持关键字"type" ;10. 发现 <li><a href="/index.php">回到前台</a></li>这样回到首页后,不是登录状态
热门推荐
  • sessionstorage - laravel 5 redis session 共享读写问题
  • sessionstorage - laravel 5 redis session 共享读写问题
  • 1.x=3 y=4 不懂
  • 2.Redis如何回收过期数据?
  • 3.angular.js - ocLazyLoad配合ui-router延迟加载controller,controller提示 not a
  • 4.$(this) 和 this 关键字在 jQuery 中有何不同?
  • 5.nginx location 匹配/status和/status/,这两个有什么区别?
  • 6.前端 - display:box box-flex 和 display:flex flex 有什么区别?
  • 7.redis - 关于php任务队列的问题
  • 8.directadmin - Nginx反代DA面板上的站点,无法访问,这是DA面板的原因吗?
  • 9.apache2.4无法启动,报错(20024)
  • 10.node.js - node pm2 如何防止项目误重启删除呢?

网公网安备:皖ICP备2020019022号-8 Copyright ¢ 2020-2025 Powered by V1.8 All Rights Reserved 技术支持:乐呵呵网

声明:本站所有资源以学习为主