file:  Screen_Main.java

package information;

import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.component.ListField;
import net.rim.device.api.ui.component.ListFieldCallback;
import net.rim.device.api.ui.decor.Background;
import net.rim.device.api.ui.decor.BackgroundFactory;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Manager;

public class Screen_Main extends MainScreen
implements ListFieldCallback {

String Data[] = {“Ciputra Hotel”,
“Garden Palace”,
“Hotel Bumi Surabaya”,
“Ibis Rajawali”,
“Java Paragon”,
“JW Marriott”,
“Majapahit Hotel”,
“Mercure Grand Mirama”,
“Novotel Surabaya”,
“Prime Royal”,
“Sheraton Surabaya”,
“Somerset”,
“Surabaya Plaza Hotel”};

private VerticalFieldManager objManager;
private Bitmap               objBitmap;
private VerticalFieldManager _manager;

ListField objList = null;

public Screen_Main(){
super();
drawComponent();
setTitle( “Mandira Abadi Supplier List Surabaya” );

//change background color
_manager = (VerticalFieldManager)getMainManager();
//Bitmap works fine in Simulator but not in the device
objBitmap = Bitmap.getBitmapResource( “blue_grad_background.png”);
//Background bg = BackgroundFactory.createLinearGradientBackground(Color.AQUA, Color.ALICEBLUE, Color.BEIGE, Color.BLANCHEDALMOND);
//Background bg = BackgroundFactory.createSolidBackground(Color.BLUE);
Background bg = BackgroundFactory.createBitmapBackground(objBitmap);
_manager.setBackground(bg);

objManager = new VerticalFieldManager( Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR ) {
protected void paint( Graphics g ){
//int y = Screen_Main.this.getMainManager().getVerticalScroll();

//g.drawBitmap( 0, y, objBitmap.getWidth(), objBitmap.getHeight(), objBitmap, 0, 0 );
//change the color of the default text
g.setColor(0xffffff);
//change the default font
g.setFont(this.getFont().derive(Font.BOLD, 16));
super.paint( g );

}

protected boolean keyDown( int keycode, int status ){
invalidate();
return super.keyDown( keycode, status );
}

protected boolean navigationMovement( int dx, int dy, int status, int time ){
invalidate();
return super.navigationMovement( dx, dy, status, time );
}

protected int moveFocus(int amount, int status, int time){
invalidate();
return super.moveFocus(amount, status, time);
}

};

add(objList);

super.add( objManager );
}

public void add( Field field ){
objManager.add( field );
}

public void delete( Field field ){
objManager.delete( field );
}

public void drawListRow(ListField listField, Graphics g, int index, int y, int width){
g.drawText(Data[index], /*10*/10, /*CTIAMain.ROW_HEIGHT*index*/y );
}

public int indexOfList(ListField listField, String prefix, int start){

return 0;
}

public Object get(ListField listField, int index){
return Data[index];
}

public int getPreferredWidth(ListField listField){
return 0;
}

private void drawComponent(){

objList = new ListField(Data.length);
objList.setCallback(this);

}

}

file: start.java

package information;
import net.rim.device.api.ui.UiApplication;

public class start extends UiApplication {

public start() {
Screen_Main SCREEN = new Screen_Main();
pushScreen(SCREEN);
}

public static void main(String args[]) {
start APP = new start();
APP.enterEventDispatcher();
}
}