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

为什么我的cell数组越位了

浏览:183日期: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. node.js - nodejs 执行shell脚本2. node.js - express路由问题3. node.js - app.get()不执行,麻烦谁指点以下。4. autodesk-forge - 以node.js 斷點續傳將模型上傳到Autodesk Forge,但api無回應?5. node.js - Node框架Egg.js和Express有何区别,哪个更适合新手学习。6. node.js - node 引入文件问题7. node.js - npm install 时报错tunneling socket could not be established求大神帮忙8. node.js - nodejs可以判断客户端的浏览器类型吗9. node.js - jsonp跨域为何get不到想要的内容10. 在node.js里面可以使用window对象的方法吗
热门推荐
  • 同一个命名空间中类的引用
  • 同一个命名空间中类的引用
  • 1.ios - JSPatch在替换方法的过程中,也就是runtime的过程中是如何拿到实例对象的?
  • 2.如何修改 docker container log 目录?
  • 3.为什么要调两个font-size
  • 4.laravel,怎么在在页面中获取Session中保存的数据
  • 5.PHP生成二维码
  • 6.框架本地搭建不了 咋整
  • 7.nginx location 匹配/status和/status/,这两个有什么区别?
  • 8.print spooler内存不能为read
  • 9.Linux下C语言的一道经典面试题
  • 10.主要想学一下分页的写法

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

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