listing programnya adalah :
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class tes extends MIDlet implements CommandListener {
Display D;
Form fr;
Command C;
public tes (){
fr = new Form ("Hello");
C= new Command ("Keluar", Command.EXIT,0);
fr.append ("Hai");
fr.addCommand (C);
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();
}
}
}
By : Cut Iswahyuni
Tidak ada komentar:
Posting Komentar