public void paintComponent(Graphics g)
{
System.out.println("*****************");//你写这条测试语句就会发现你的paintComponent方法在无穷执行,你明白了吗???
super.paintComponent(g);
setForeground(Color.green);
g.drawLine(0,bottom,1000,bottom);
setForeground(Color.red);
g.drawLine(0,bottom,1000,bottom);
}
{
System.out.println("*****************");//你写这条测试语句就会发现你的paintComponent方法在无穷执行,你明白了吗???
super.paintComponent(g);
setForeground(Color.green);
g.drawLine(0,bottom,1000,bottom);
setForeground(Color.red);
g.drawLine(0,bottom,1000,bottom);
}
解决方案 »
- 打包发现错误
- 请问如何抓取动态网页
- 求 人力资源管理系统 jsp论文
- package system does not exit是什么问题?
- jni 调 dll问题
- java环境配置问题:“‘JAVAC’不是内部或外部命令,也不是可运行的程序或批处理文件”,怎么办?在线等,解决后马上给分
- 有经验的高手们,给小第指条明路,学JAVA,从哪里起步???多谢!!!
- 网页中如何插入applet?要支持ie6的
- 很疑惑,用接口继承一个类时子类并不会有父类的具体代码,那么这样继承过来有什么用?
- 如何写sql像 select * from itop_public_message where name like '%'%'这样的语句
- 为什么会出现这样的编译信息呢?
- 谁有JBuilder的注册吗
你可以设置一个boolean flag=true变量做初始化的标志,初始化完毕,就修改flag=false;
第二:你可以将你的panel组件(j)放在另一个JPanel中,如:
JPanel P = new JPanel();
......
P.add(j,null);
this.add(P,null);
.........