📄 hellomidlet.java
字号:
package sojiture;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2006</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class HelloMIDlet extends MIDlet implements CommandListener//
{
private Command exitCommand;//
private Display display;
//static HelloMIDlet instance;
//Displayable1 displayable = new Displayable1();
public HelloMIDlet() {
//instance = this;
display = Display.getDisplay(this);//
exitCommand = new Command("离开",Command.BACK,1);//
}
public void startApp() {
TextBox t = new TextBox("Welcome,my friend.","Forever",256,0);
t.addCommand(exitCommand);
t.setCommandListener(this);
display.setCurrent(t);
//Display.getDisplay(this).setCurrent(displayable);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
//事件监听
public void commandAction(Command c,Displayable s)
{
if (c == exitCommand)
{
destroyApp(false);
notifyDestroyed();
}
}
/*
public static void quitApp() {
instance.destroyApp(true);
instance.notifyDestroyed();
instance = null;
}
*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -