我买了一本书<高级黑莓6开发>。我能够让midlet示例工作,但不是CLDC程序的第一个示例。它似乎从来没有达到代码,当我运行应用程序时,我得到一个空白的白屏。我试着设置一个断点,但它从来没有发生过。
以下是代码
package test.org;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
public class cHelloUniverses extends UiApplication{
public static void main(String[] args)
{
(new cHelloUniverses()).start();
}
public void start()
{
MainScreen main = new MainScreen();
LabelField label= new LabelField("Hello Ted");
main.add(label);
UiApplication app = UiApplication.getUiApplication();
app.pushScreen(main);
app.enterEventDispatcher();
}
}发布于 2011-04-26 07:43:33
将start()方法替换为:
public void start()
{
MainScreen main = new MainScreen();
LabelField label= new LabelField("Hello Ted");
main.add(label);
this.pushScreen(main);
this.enterEventDispatcher();
}https://stackoverflow.com/questions/5784014
复制相似问题