Showing posts with label List. Show all posts
Showing posts with label List. Show all posts

Wednesday, 16 June 2010

List

This code use to make List in j2me
Kode dibawah ini digunakan untuk membuat List di j2me

import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.List;
import javax.microedition.midlet.*;

/**
* free to distribute but forbiden to delete this statement
* @author b1ms.wordpress.com
* ym : thats_myboy@yahoo.com
* "share code for free"
*/
public class CreatingList extends MIDlet {
private Display display;
private List list;

public CreatingList() {
display = Display.getDisplay(this);
list = new List("Select one", List.EXCLUSIVE);
list.append("isi 1", null);
list.append("isi 2", null);

}

public void startApp() {
display.setCurrent(list);
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}

}

download source

Running program



Untuk bentuk list yang lain
For the different list

list = new List("Select one", List.EXCLUSIVE);

Dapat diganti
Can change with

list = new List("Select one", List.IMPLICIT);

atau
or

list = new List("Select one", List.MULTIPLE);

smoga bermanfaat

hope useful for u
blog ini ditujukan pada smua orang yang mempunyai penghargaan tertinggi terhadap sesuatu yang mereka cinta dan sayangi