Contoh Program List Implicit
import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.*;
public class cthImplicit extends MIDlet implements CommandListener
{
private List menupil;
private Command cmdExit;
private Display display;
public cthImplicit(){
display=Display.getDisplay(this);
menupil=new List("Pilihan",List.IMPLICIT);
menupil.append("VIP",null);
menupil.append("Bisnis",null);
menupil.append("Ekonomi",null);
menupil.append("Keluar",null);
menupil.setCommandListener(this);
}
public void startApp(){
display.setCurrent(menupil);
}
public void pauseApp(){}
public void destroyApp(boolean unconditional){}
public void commandAction(Command c, Displayable d){
if(menupil.isSelected(3)){
destroyApp(false);
notifyDestroyed();
}
}
}
Posting Komentar