parent
f76d23a92d
commit
e4be4ef440
@ -0,0 +1,22 @@
|
|||||||
|
package cn.edu.caztc.sokobangame;
|
||||||
|
import javax.swing.JPanel;
|
||||||
|
|
||||||
|
public class UpdateThread extends Thread{
|
||||||
|
JPanel panel;
|
||||||
|
public UpdateThread(JPanel panel) {
|
||||||
|
this.panel = panel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
while(true){
|
||||||
|
panel.repaint();
|
||||||
|
try {
|
||||||
|
Thread.sleep(10);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue