displayable1.java~1~
来自「这是一个关于Java 2 Mobile Edition 的自定义组件的部分源码,」· JAVA~1~ 代码 · 共 39 行
JAVA~1~
39 行
package customitem;
import javax.microedition.lcdui.*;
public class Displayable1 extends Canvas implements CommandListener {
/** Constructor */
public Displayable1() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
/**Component initialization*/
private void jbInit() throws Exception {
// Set up this Displayable to listen to command events
setCommandListener(this);
// add the Exit command
addCommand(new Command("Exit", Command.EXIT, 1));
}
/**Handle command events*/
public void commandAction(Command command, Displayable displayable) {
/** @todo Add command handling code */
if (command.getCommandType() == Command.EXIT) {
// stop the MIDlet
MIDlet1.quitApp();
}
}
/** Required paint implementation */
protected void paint(Graphics g) {
/** @todo Add paint codes */
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?