This code use to make StringItem in j2me
Kode dibawah ini digunakan untuk membuat StringItem di j2me
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;
import javax.microedition.midlet.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 CreatingStringItem extends MIDlet {
private Display display;
private Form form;
private StringItem str1;
private StringItem str2;
public CreatingStringItem() {
display = Display.getDisplay(this);
form = new Form("Display Form ");
str1 = new StringItem("StringItem 1 ", "test stringitem 1");
str2 = new StringItem("StringItem 2: ", "test stringitem 2");
form.append(str1);
form.append(str2);
}
public void startApp() {
display.setCurrent(form);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}
download source
Running program
smoga bermanfaat
hope useful for u
No comments:
Post a Comment