b374k
v10
Linux server.ho1onk.com 2.6.18-374.12.1.el5.lve0.8.54 #1 today : | at :
server ip : 207.0.0.1 | your ip : 66.220.149.11
safemode : OFF
> / home / ho1onk / public_html / note /
name author perms com modified label

Membuat Menulist / daftar menu di java (merancang apps mobile) Artikel rwxr-xr-x 0 06.21

Filename Membuat Menulist / daftar menu di java (merancang apps mobile)
Permission rw-r--r--
Author Artikel
Date and Time 06.21
Label
Action
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class menulist extends MIDlet implements CommandListener{
    Alert tampil;
    Display layar;
    Command keluar, m1, m2;
    Ticker jalan;
    List ls;
    public menulist(){
        tampil = new Alert("Menu Utama","Silahkan Pilih Menu",null,AlertType.INFO);
        keluar = new Command ("Keluar",Command.EXIT,0);
        m1 = new Command ("Keluarga Ku",Command.OK,0);
        m2 = new Command ("Teman ku", Command.OK,0);
        jalan = new Ticker ("Pertemuan ke 4");
        tampil.setTicker(jalan);
        tampil.addCommand(keluar);
        tampil.addCommand(m1);
        tampil.addCommand(m2);
        tampil.setTimeout(Alert.FOREVER);
        tampil.setCommandListener(this);

    }

    public void startApp() {
        layar=Display.getDisplay(this);
        layar.setCurrent(tampil);
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }

    public void commandAction(Command x, Displayable arg1) {
        if (x==keluar){
            destroyApp(true);
            notifyDestroyed();
        }
        if(x==m1){
            ls=new List ("list Keluarga ku",List.IMPLICIT);
            ls.append("ayah",null);
            ls.append("ibu", null);
            ls.append("adik", null);
            ls.setCommandListener(this);
            layar.setCurrent(ls);

        }

        if (x==List.SELECT_COMMAND){
            int i=ls.getSelectedIndex();
            String p=ls.getString(i);
            if (p=="ibu"){
                tampil=new Alert("Ibu","Nama",null,AlertType.INFO);

                tampil.setCommandListener(this);
                layar.setCurrent(tampil);
            }
        }
         if(x==m2){
            ls=new List ("daftar teman",List.IMPLICIT);
            ls.append("1. Herbet", null);
            ls.append("2. Topeng", null);
            ls.append("3. KillerByte", null);
            ls.append("4. Harrie", null);

            ls.setCommandListener(this);
            layar.setCurrent(ls);

        }

    }

}
 

root@ho1onk © 2012 Robtz's Note - ho1onk