📄 midlet6.java
字号:
package prj5_1;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Item;
import javax.microedition.lcdui.StringItem;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class MIDlet6 extends MIDlet {
private Form mainForm = new Form("这是一个含有StringItem的Form");
private Display dis;
private StringItem si1 = new StringItem("StringItem1标题","StringItem1内容");
private StringItem si2 = new StringItem("StringItem2标题","StringItem2内容",Item.PLAIN);
private StringItem si3 = new StringItem("StringItem3标题","StringItem3内容",Item.BUTTON);
private StringItem si4 = new StringItem("StringItem4标题","StringItem4内容",Item.HYPERLINK);
protected void startApp() throws MIDletStateChangeException {
dis = Display.getDisplay(this);
dis.setCurrent(mainForm);
mainForm.append(si1);
mainForm.append(si2);
mainForm.append(si3);
mainForm.append(si4);
si3.addCommand(new Command("",Command.ITEM,1));
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
}
protected void pauseApp() {
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -