
package hello;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
/**
* @author mahendra
*/
public class StringItemm extends MIDlet implements CommandListener{
private Display display;
private Form stringForm;
private Command exitCommand;
public StringItemm(){
exitCommand = new Command("Exit", Command.EXIT, 1);
stringForm = new Form("StringField Modes");
stringForm.addCommand(exitCommand);
stringForm.setCommandListener(this);
StringItem plain = new StringItem("Plain", "Plain Text", Item.PLAIN);
StringItem hyperlink = new StringItem("Hyperlink", "http://www.sun.com",Item.HYPERLINK);
hyperlink.setDefaultCommand(new Command("Set", Command.ITEM, 0));
//hyperlink.setItemCommandListener(this);
StringItem button = new StringItem("Button", "Click me", Item.BUTTON);
button.setDefaultCommand(new Command("Set", Command.ITEM, 0));
// button.setItemCommandListener(this);
stringForm.append(plain);
stringForm.append(hyperlink);
stringForm.append(button);
}
public void startApp() {
display = Display.getDisplay(this);
display.setCurrent(stringForm);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command c, Displayable d) {
if(c==exitCommand){
destroyApp(false);
notifyDestroyed();
}
}
}
download sourcenya disini
pass: arfianhidayat
wah, copas punyaku ki http://arfianhidayat.com/
sumber disertakan donk
author juga jangan diganti