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

为什么我的cell数组越位了

浏览:172日期: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. intellij-idea - 使用IDEA+Struts2.0+Apache6.0启动失败2. openresty - 利用lua-nginx-module修改upstream中内容并重新reload3. 配置apache访问svn怎么操作4. apache - 做负载均衡的 nginx 主机配置是不是差一点也没关系?5. Apache服务器开启HTTPS访问6. Apache重写路由,隐藏index.php在本地环境失效7. apache - 如何在 .htaccess 设置规则阻止下载 .htaccess 文件8. apache - 用Appache在windows上搭了文件服务器,速度很慢9. express - nginx配置后访问不到主动ajax请求?10. apache 的 aliases,redirecting,rewriting 都有什么区别?
热门推荐
  • 如何修改 docker container log 目录?
  • 如何修改 docker container log 目录?
  • 1.redis可以多key对应一个value吗?
  • 2.python - 含中文JSON未能按期待进行dumps,(\xxx\xxx\xxx)?
  • 3.nginx rewrite 正则表达式
  • 4.Linux下C语言的一道经典面试题
  • 5.500 - nginx如何减少5xx错误
  • 6.weex 在android端自定义的WXComponent怎样重写宿主Activity的onBackPressed方法
  • 7.node.js - express 4.x版本post请求
  • 8.angular.js - AngularJS 如何运行 Controller 以外的函数呢?
  • 9.android - 请问安卓中自定义的内容提供器对外声明唯一uri的语句在哪?
  • 10.angular.js - angularjs中该如何设置一段cookie今天24点之后过期?

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

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