Java Middlet notes

 

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class awal extends MIDlet
implements CommandListener {
Form     f;
Command cmdOK;

public awal() {
f = new Form(“Kursus J2ME Malam”);
try {
Image img = Image.createImage(“/logo.png”);
f.append(img);
} catch(Exception e) {
System.out.println(e);
}
f.append(“\nKursus Malam”);
f.append(“\nPanas Cuuuyyyy”);
f.append(“\nKaga Pake AC”);

Ticker t = new Ticker(
“selamat Datang “+
“di Lab Aplikasi & Pemrograman” );
f.setTicker(t);

cmdOK=new Command(“OK”,Command.OK,1);

f.addCommand(cmdOK);
f.setCommandListener(this);
}
public void startApp() {
Display d = Display.getDisplay(this);
d.setCurrent(f);
}
public void pauseApp() { }
public void destroyApp(boolean b) { }

public void commandAction(Command c,
Displayable d ) {
if(c==cmdOK) {
notifyDestroyed();
}
}
}