在java的jpanel绘制图形
使用paint方法,在里面使用super.paint清除之前的残留
在while里使用repaint进行循环绘画
public void display() {
this.repaint();
}
public void paint(Graphics g) {
super.paint(g);
dao.drawBackground(g);
dao.drawState(g, hero);
}
while(true) {
start.display();
try
{
Thread.sleep(300);
标签:java,void,paint,swing,图形,绘制,public
From: https://www.cnblogs.com/tuzichun/p/17079093.html