Listing Programnya :
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class tess extends MIDlet implements CommandListener {
Display D;
Form fr,fr1;
Command C,C1,C2;
public tess (){
fr = new Form ("Hello");
fr1 = new Form ("Ayah");
C = new Command ("Keluar", Command.EXIT,0);
C1 = new Command ("Ayah", Command.OK,0);
C2 = new Command ("Ibu", Command.OK,1);
fr.append("Hai Cut Iswahyuni");
fr1.append("Nama Ayah: Togar back\nPekerjaan: Wiraswasta");
fr.addCommand(C);
fr.addCommand(C1);
fr.addCommand(C2);
fr.setCommandListener(this);
}
public void startApp() {
D=Display.getDisplay(this);
D.setCurrent(fr);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command arg0, Displayable arg1) {
if (arg0==C){
destroyApp(true);
notifyDestroyed();
}
if (arg0==C1){
D.setCurrent(fr1);
}
}
}
By : Cut Iswahyuni
Tidak ada komentar:
Posting Komentar