p;
/*
* stringItemlet.java
*
* Created on 2005年4月14日, 下午4:26
*/
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
*
* @author Administrator
* @version
*/
public class stringItemlet extends MIDlet implements CommandListener,
ItemCommandListener{
private Form aform;
private Command okCommand;
private Command exitCommand;
private Command hllinkCommand;
private Command bCommand;
private Display aDisplay;
private StringItem hlstringItem;
private StringItem bstringItem;
private Alert hlAlert;
private Alert bAlert;
public stringItemlet(){
okCommand=new Command("OK",Command.OK,1);
exitCommand=new Command("EXIT",Command.EXIT,1);
hllinkCommand=new Command("LINK",Command.ITEM,2);
bCommand=new Command("BUTTON",Command.ITEM,2);
aform=new Form("StringItemTest");
//if click hyperlink "here",display anAlert
hlstringItem=new StringItem(null,"here",Item.HYPERLINK);
hlstringItem.setItemCommandListener(this);
hlstringItem.setDefaultCommand(hllinkCommand);
bstringItem=new StringItem(null,"Available?",Item.BUTTON);
bstringItem.setItemCommandListener(this);
bstringItem.setDefaultCommand(bCommand);
hlAlert=new Alert("Item.HYPERLINK","You Can Call Me 800-8101234"
,null,AlertType.INFO);
bAlert=new Alert("Item.Button","The Button is Available!"
,null,AlertType.INFO);
aform.append("Any question ,please click ");
aform.append(hlstringItem);
aform.append(bstringItem);
aform.addCommand(okCommand);
aform.addCommand(exitCommand);
aform.setCommandListener(this);
}
public void startApp() {
aDisplay=Display.getDisplay(this);
aDisplay.setCurrent(aform);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command c ,Displayable d){
if(c==exitCommand){
上一页12 下一页