Listing Program :
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class kedua extends MIDlet implements CommandListener {
Command H1,H2,H3,H4,Keluar,back;
Ticker t;
Form futama,F1;
Display D;
public kedua(){
H1=new Command("halaman1",Command.OK,0);
H2=new Command("halaman 2",Command.OK,1);
H3=new Command("halaman 3",Command.OK,2);
H4=new Command("halaman 4",Command.OK,3);
Keluar=new Command("Keluar",Command.EXIT,0);
back=new Command("Back",Command.BACK,0);
t=new Ticker("Selamat Datang Cut Iswahyuni ");
futama=new Form("halaman utama");
futama.append("Pilih Menu Utaman Untuk memulai");
futama.addCommand(H1);
futama.addCommand(H2);
futama.addCommand(H3);
futama.addCommand(H4);
futama.addCommand(H4);
futama.addCommand(Keluar);
futama.setTicker(t);
futama.setCommandListener(this);
F1=new Form("halaman1");
F1.addCommand(back);
F1.setCommandListener(this);
}
public void startApp() {
D=Display.getDisplay(this);
D.setCurrent(futama);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command x, Displayable arg1) {
if(x==Keluar){
destroyApp(true);
notifyDestroyed();
}
if(x==back){
D.setCurrent(futama);
}
if(x==H1){
D.setCurrent(F1);
}
}
}
By : Cut Iswahyuni
Tidak ada komentar:
Posting Komentar