Here is a sample:
Code:
import net.rim.blackberry.api.homescreen.HomeScreen;
import net.rim.device.api.system.Bitmap;
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 {
public static void main(String[] args) {
final HelloWorld theApp = new HelloWorld();
if (HomeScreen.supportsIcons()) {
System.out.println("supportsIcons == true");
Bitmap icon1 = Bitmap.getBitmapResource("icon1.png");
Bitmap icon2 = Bitmap.getBitmapResource("icon2.png");
HomeScreen.updateIcon(icon1);
HomeScreen.setRolloverIcon(icon2);
} else {
System.out.println("supportsIcons == false");
}
theApp.enterEventDispatcher();
}
public HelloWorld() {
pushScreen(new HelloWorldScreen());
}
}
class HelloWorldScreen extends MainScreen {
public HelloWorldScreen() {
super(DEFAULT_MENU | DEFAULT_CLOSE);
setTitle(new LabelField("Hello world demo", LabelField.ELLIPSIS
| LabelField.USE_ALL_WIDTH));
}
}
Wish it's helpful.