作者: 邓明轩、俞伟
主应用 程序 类创 建后 该类 对应 的 ja v a 代码 将自 动显 示在程 序编 辑框 中, 参考 下面提 供
的完整 代码 在 m ai n 函数 中插入 新建 实例 和运 行实 例的代 码, 并添 加 H ello W o rld 构造函 数。 代码添 加完 成后 如下 图:
为了方 便读 者, 下面 提供 该类的 完整 代码 :
package com.bbtest.helloworld;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.MainScreen;
public class HelloWorld extends UiApplication {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto -generated method stub
HelloWorld _app= new HelloWorld();
_app.enterEventDispatcher();
}
public HelloWorld()
17 |
MainScreen screen = new MainScreen();
LabelField label = new LabelField( "Hello World!" );
screen.add(label);
this .pushScreen(screen);
}
}
输入代 码后 保存 该类 , 对 系统提 示