当前位置: 技术问答>java相关
我写的一个线程类。为什么我一调用整个程序就跟死了一样,特别的慢?请高手帮忙看看这个线程类的代码有什么问题.
来源: 互联网 发布时间:2017-03-30
本文导语: class CDropThread extends Thread{ final static int MILLIS=10000; private int iCanvasHeight; private CMainCanvas MainCanvas; CDropThread(){} CDropThread(CMainCanvas pMainCanvas,int pCanvasHeight){ this.MainC...
class CDropThread extends Thread{
final static int MILLIS=10000;
private int iCanvasHeight;
private CMainCanvas MainCanvas;
CDropThread(){}
CDropThread(CMainCanvas pMainCanvas,int pCanvasHeight){
this.MainCanvas = pMainCanvas;
this.iCanvasHeight = pCanvasHeight;
}
public void run(){
while(true)
{
MainCanvas.moveDrop(10);
if (iCanvasHeight
final static int MILLIS=10000;
private int iCanvasHeight;
private CMainCanvas MainCanvas;
CDropThread(){}
CDropThread(CMainCanvas pMainCanvas,int pCanvasHeight){
this.MainCanvas = pMainCanvas;
this.iCanvasHeight = pCanvasHeight;
}
public void run(){
while(true)
{
MainCanvas.moveDrop(10);
if (iCanvasHeight