📄 hellomidlet.java
字号:
/*
* HelloMIDlet.java
*
* Created on 2007年3月28日, 上午8:51
*/
package com.tan.ui;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
*
* @author USER
* @version
*/
public class HelloMIDlet extends MIDlet implements CommandListener{
private TextBox helloTextBox;
private Command exitCommand;
public void startApp() {
init();
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
public void commandAction(Command command, Displayable displayable) {
if(displayable == helloTextBox)
{
if(command == exitCommand)
{
Display.getDisplay(this).setCurrent(null);
destroyApp(true);
notifyDestroyed();
}
}
}
private void init() {
Display.getDisplay(this).setCurrent(gethellBox());
}
private Command getExitCommand()
{
if(exitCommand == null)
{
exitCommand = new Command("Exit",Command.EXIT,1);
}
return exitCommand;
}
private TextBox gethellBox()
{
if(helloTextBox == null)
{
helloTextBox = new TextBox(null,"Text String",120,0x0);
helloTextBox.addCommand(getExitCommand());
helloTextBox.setCommandListener(this);
}
return helloTextBox;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -