Posted by: Joehakim on: Januari 6, 2009
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class HelloMidlet extends MIDlet
implements CommandListener {
Display display;
Command exitCommand =
new Command(“Exit”, Command.EXIT, 1);
Alert helloAlert;
public HelloMidlet(){
helloAlert = new Alert(
“Hello MIDlet”, “Hallo, dunia!”,
null, AlertType.INFO
);
helloAlert.setTimeout(Alert.FOREVER);
helloAlert.addCommand(exitCommand);
helloAlert.setCommandListener(this);
}
public void startApp() {
if (display == null){
display = Display.getDisplay(this);
}
display.setCurrent(helloAlert);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command c, Displayable d)
{
if (c==exitCommand)
{
destroyApp(true);
notifyDestroyed();
}
}
}
hasil program saat di jalankan :

selamat mencoba…. semoga berhasil