Hello World

BY IN Blackberry Comments Off on Hello World

package helloworld;

/**
* HelloWorld.java
* Copyright (C) 2001-2004 Research In Motion Limited. All rights reserved.
*/

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;

public class Hello extends UiApplication {
public static void main(String[] args) {
Hello theApp = new Hello();
theApp.enterEventDispatcher();
}
public Hello() {
pushScreen(new HelloWorldScreen());
}
}

final class HelloWorldScreen extends MainScreen {
public HelloWorldScreen() {
super();
LabelField title = new LabelField(“HelloWorld Sample”, LabelField.ELLIPSIS
| LabelField.USE_ALL_WIDTH);
setTitle(title);
add(new RichTextField(“Hello World!”));
}

public boolean onClose() {
Dialog.alert(“Goodbye!”);
System.exit(0);
return true;
}
}




Comments are closed.