import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class kuis extends MIDlet implements CommandListener {
Display layar;
Alert pesan ;
Command keluar;
Command cc,sp,ft,tb,kl,bb,bk;
public kuis() {
cc=new Command ("Coca Cola",Command.OK,0);
sp=new Command ("sprite",Command.OK,0);
ft=new Command ("Fanta",Command.OK,0);
tb=new Command ("Teh Botol",Command.OK,0);
kl=new Command ("kaleng",Command.OK,0);
bb=new Command ("botol besar",Command.OK,0);
bk=new Command ("botol kecil",Command.OK,0);
keluar =new Command("k-e-l-u-a-r",Command.EXIT,0);
pesan=new Alert("NOBP:09101152630299/Khairul Amri",
"informasi harga\n" +
"Minuman\n" +
"SoftDrink",null,AlertType.INFO);
pesan.addCommand (keluar);
pesan.addCommand(cc);
pesan.addCommand(sp);
pesan.addCommand(ft);
pesan.addCommand(tb);
pesan.setTimeout(Alert. FOREVER);
pesan.setCommandListener(this);
}
public void startApp() {
layar=Display.getDisplay(this);
layar.setCurrent(pesan);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction (Command anu, Displayable arg1){
if (anu==keluar ){
destroyApp(true);
notifyDestroyed();
}
if (anu==cc){
pesan=new Alert ("Informasi Harga coco cola",
"Minuman ini cocok\n" +
"Diminum Saat Dingin\n" +
"Dan cuaca Panas ",null,AlertType.WARNING);
pesan.setCommandListener(this);
pesan.addCommand(keluar);
pesan.addCommand(keluar);
pesan.addCommand(kl);
pesan.addCommand(bb);
pesan.addCommand(bk);
pesan.setTimeout(Alert. FOREVER);
pesan.setCommandListener(this);
layar.setCurrent(pesan);
}
if (anu==kl){
pesan=new Alert ("Informasi Harga coco cola",
"kemasan :kaleng\n" +
"isi:5ml\n" +
"harga:rp5000 ",null,AlertType.WARNING);
pesan.setCommandListener(this);
pesan.addCommand(keluar);
pesan.setTimeout(Alert.FOREVER);
layar.setCurrent(pesan);
}
}
}
import javax.microedition.lcdui.*;
public class kuis extends MIDlet implements CommandListener {
Display layar;
Alert pesan ;
Command keluar;
Command cc,sp,ft,tb,kl,bb,bk;
public kuis() {
cc=new Command ("Coca Cola",Command.OK,0);
sp=new Command ("sprite",Command.OK,0);
ft=new Command ("Fanta",Command.OK,0);
tb=new Command ("Teh Botol",Command.OK,0);
kl=new Command ("kaleng",Command.OK,0);
bb=new Command ("botol besar",Command.OK,0);
bk=new Command ("botol kecil",Command.OK,0);
keluar =new Command("k-e-l-u-a-r",Command.EXIT,0);
pesan=new Alert("NOBP:09101152630299/Khairul Amri",
"informasi harga\n" +
"Minuman\n" +
"SoftDrink",null,AlertType.INFO);
pesan.addCommand (keluar);
pesan.addCommand(cc);
pesan.addCommand(sp);
pesan.addCommand(ft);
pesan.addCommand(tb);
pesan.setTimeout(Alert. FOREVER);
pesan.setCommandListener(this);
}
public void startApp() {
layar=Display.getDisplay(this);
layar.setCurrent(pesan);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction (Command anu, Displayable arg1){
if (anu==keluar ){
destroyApp(true);
notifyDestroyed();
}
if (anu==cc){
pesan=new Alert ("Informasi Harga coco cola",
"Minuman ini cocok\n" +
"Diminum Saat Dingin\n" +
"Dan cuaca Panas ",null,AlertType.WARNING);
pesan.setCommandListener(this);
pesan.addCommand(keluar);
pesan.addCommand(keluar);
pesan.addCommand(kl);
pesan.addCommand(bb);
pesan.addCommand(bk);
pesan.setTimeout(Alert. FOREVER);
pesan.setCommandListener(this);
layar.setCurrent(pesan);
}
if (anu==kl){
pesan=new Alert ("Informasi Harga coco cola",
"kemasan :kaleng\n" +
"isi:5ml\n" +
"harga:rp5000 ",null,AlertType.WARNING);
pesan.setCommandListener(this);
pesan.addCommand(keluar);
pesan.setTimeout(Alert.FOREVER);
layar.setCurrent(pesan);
}
}
}


0 komentar:
Posting Komentar