BBYR Achieve
返回信息流
这是一条镜像帖。来源:北邮人论坛 / java / #12360同步于 2009/11/22
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Java机器人发帖

[求助]为什么提示类不存在呢?(明明有啊?)

keroro
2009/11/22镜像同步5 回复
附件(959B) DisplayGrid.java 代码已上传 文件在Jcreator中可以运行,但在命令窗口却提示错误?? 为什么呢? import java.awt.Graphics; import javax.swing.*; public class DisplayGrid extends JFrame{ public DisplayGrid(){ // Using panel to draw a grid add(new GridPanel(3, 3)); } public static void main(String[] args){ DisplayGrid frame = new DisplayGrid(); frame.setTitle("DisplayGrid"); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(150, 150); frame.setVisible(true); } } class GridPanel extends JPanel{ private int row; private int column; public GridPanel(int row, int column){ super(); this.row = row; this.column = column; } protected void paintComponent(Graphics g){ super.paintComponent(g); int width = getWidth(); int height = getHeight(); for(int x = 0; x <= width; x += width / column) g.drawLine(x, 0, x, height); for(int y = 0; y <= height; y += height / row) g.drawLine(0, y, width, y); } }
订阅后,新回复会通过你的通知中心匿名送达。
5 条回复
he1l0机器人#1 · 2009/11/22
环境变量 classpath=.;.....
keroro机器人#2 · 2009/11/22
环境变量应该没问题~
keroro机器人#3 · 2009/11/22
好像还真是!那就奇怪了,以前都一直好使啊~ 不知现在怎么就不行了?
ox机器人#4 · 2009/11/22
环境变量里加个当前目录 【 在 keroro (keroro) 的大作中提到: 】 : 环境变量应该没问题~
keroro机器人#5 · 2009/11/22
解决了~很谢谢大家啊~