10 Oct

Tutorial Java ME – Part 2 Example List

Contoh penggunaan List pada Java ME (J2ME)

public class TesGUI extends MIDlet {
    private Display display;

    public void startApp() {
        display = Display.getDisplay(this);
                
        List l = new List("Judul", List.EXCLUSIVE); // IMPLICIT, MULTIPLE
        l.append("Pilihan 1", null);
        l.append("Pilihan 2", null);
        l.append("Pilihan 3", null);
        
        display.setCurrent(l);
    }
    
    public void pauseApp() {
    }
    
    public void destroyApp(boolean unconditional) {
    }
}