📄 cb.java
字号:
// colorbugs
// coded by Tota
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
//Midp class
public class Cb extends MIDlet implements CommandListener {
private Display display;
private Command exit;
private MyCanvas canvas;
private Command helpCommand;
/* Start Addition 17-03-2003 for external events */
private boolean firstTime;
/* End Addition 17-03-2003 */
public Cb(){
display = Display.getDisplay(this);
exit=new Command("Exit",Command.EXIT,1);
helpCommand =new Command("Help",Command.SCREEN,2);
}
/* start */
public void startApp(){
/* Start Modified 17-03-2003 for external events */
if(!firstTime){
canvas=new MyCanvas();
canvas.addCommand(exit);
canvas.addCommand(helpCommand);
canvas.setCommandListener(this);
display.setCurrent(canvas);
firstTime = true;
}else {
canvas.onoff = true;
}
/* End Modified 17-03-2003 */
}
public void pauseApp()
{
/* Start Addition 20-03-2003 */
canvas.onoff = false;
/* End Addition 20-03-2003 */
}
public void destroyApp(boolean unconditional)
{
}
public void commandAction(Command c,Displayable s)
{
if (c==exit)
{
destroyApp(false);
notifyDestroyed();
}else if(c== helpCommand){
/* Start Modified 17-03-2003 for help text */
Alert alert=new Alert("Help","Use the number keys to attract "+
"bugs into the different spots.",
null,AlertType.INFO);
//Alert alert=new Alert("help","use number_keys to attract bugs into different spots",null,AlertType.INFO);
/* End Modified 17-03-2003 */
alert.setTimeout(Alert.FOREVER);
display.setCurrent(alert);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -