我正在使用 LWUIT 在模拟器中开发 Xlet 项目。该项目是多线程的,当其中一个线程完成工作然后死掉或者刚刚进入wain()状态时,会调用显示表单的repaint()方法,屏幕会闪烁(白屏一拍然后返回正常)。
部分代码如下:
public class LwuitWhiteScreenXlet implements Xlet {
private Image bgImage;
Form form;
Thread thread;
public void destroyXlet(boolean arg0) throws XletStateChangeException {
// TODO Auto-generated method stub
}
public void initXlet(XletContext arg0) throws XletStateChangeException {
form = new Form();
/*Form initialize, code omitted*/
}
public void pauseXlet() {
// TODO Auto-generated method stub
}
public void startXlet() throws XletStateChangeException {
System.out.println("Xlet startXlet START++++++++++++++++++++");
thread = new Thread((new Runnable() {
public void run() {
Image image = null;
try {
image = Image.createImage("/res/arrow.png");
} catch (IOException e) {
e.printStackTrace();
}
Label labelTmp = new AnimatedLabel(image, 3);
}
}));
thread.start();
form.show();
System.out.println("Xlet startXlet END ------------------");
}
}
有没有人也遇到过这个问题?