📄 keypressedmidlet.java
字号:
/**源代码由程序员联合开发网(www.pudn.com)会员"周润发"收集、整理、重新编辑
*Email: ql_chuanzhang@tom.com
*QQ号:1103798882
*欢迎大家与我联系互相交流学习
**/
package KeyPressed_package;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class KeyPressedMidlet extends MIDlet implements CommandListener{
private KeyPressedCanvas kc;
public Command ExitCom;
public KeyPressedMidlet() {
// TODO Auto-generated constructor stub
ExitCom = new Command("退出" , Command.EXIT , 1);
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub
}
protected void pauseApp() {
// TODO Auto-generated method stub
}
protected void startApp() throws MIDletStateChangeException {
// TODO Auto-generated method stub
kc = new KeyPressedCanvas();
kc.addCommand(ExitCom);
kc.setCommandListener(this);
Display.getDisplay(this).setCurrent(kc);
}
public void commandAction(Command c, Displayable s) {
// TODO Auto-generated method stub
if(c==ExitCom){
try {
this.destroyApp(true);
} catch (MIDletStateChangeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
this.notifyDestroyed();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -