这段主要代码的作用是,当运行时,首先出现fstcvs这个画面,这个画面有一个进度条,是用线各实现的。当进度条显示完全后,就转到另一张画
这段主要代码的作用是,当运行时,首先出现fstcvs这个画面,这个画面有一个进度条,是用线各实现的。当进度条显示完全后,就转到另一张画面,welcvs上去,这个功能基本已完成。现在fstcvs上还有一个Command(clrcmd),当点击这个Command的时候,不管进度条到了哪里,都要转到welcvs这个界面,这个问题如何来做?
public void startApp()
{
fstcvs=new CANVAS1();
welcvs=new CANVAS2();
fstcvs.setCommandListener(this);
fstcvs.addCommand(exitcmd);
fstcvs.addCommand(clrcmd);
display.setCurrent(fstcvs);
welcvs.setCommandListener(this);
welcvs.addCommand(exitcmd);
welcvs.addCommand(rencmd);
welcvs.addCommand(delcmd);
mythread mth=new mythread();
while(mth.td.isAlive())
{
}
display.setCurrent(welcvs);
}
class mythread extends Thread
{
Thread td;
mythread()
{
td=new Thread(this);
td.start();
}
public void run()
{
for(int i=0;i<1000;i++)
{
fstcvs.getlev(i/10);
fstcvs.repaint();
display.setCurrent(fstcvs);
}
}
}