CommandDemo_2.java
资源名称:J2ME&Game.rar [点击查看]
上传用户:gyyuli
上传日期:2013-07-09
资源大小:3050k
文件大小:1k
源码类别:
J2ME
开发平台:
Java
- import javax.microedition.midlet.MIDlet;
- import javax.microedition.lcdui.*;
- public class CommandDemo_2 extends MIDlet {
- private Display display;
- private TextBox textBox;
- public CommandDemo_2() {
- display = Display.getDisplay(this);
- textBox = new TextBox("Command演示","添加了多个Command命令",50,0);
- textBox.addCommand(new Command("Open",Command.SCREEN,1));
- textBox.addCommand(new Command("Save",Command.SCREEN,1));
- textBox.addCommand(new Command("Info",Command.SCREEN,1));
- textBox.addCommand(new Command("Back",Command.SCREEN,1));
- textBox.addCommand(new Command("Exit",Command.SCREEN,1));
- }
- protected void startApp() {
- display.setCurrent(textBox);
- }
- protected void destroyApp(boolean unconditional) {
- }
- protected void pauseApp() {
- }
- }