?? simplemidlet.java
字號(hào):
package com.j2medev.chapter2;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import java.io.*;
public class SimpleMIDlet extends MIDlet implements CommandListener {
private Display display = null;
private Command exitCommand = new Command("退出", Command.EXIT, 0);
public void startApp() {
display = Display.getDisplay(this);
Form mainForm = new Form("simple");
Image img = null;
try{
img = Image.createImage("/JavaPowered.png");
}catch(IOException ex){
ex.printStackTrace();
}
if(img != null)
mainForm.append(img);
mainForm.addCommand(exitCommand);
mainForm.setCommandListener(this);
display.setCurrent(mainForm);
}
public void pauseApp () {}
public void destroyApp(boolean unconditional) {}
public void commandAction(Command cmd, Displayable s) {
if (cmd==exitCommand)
notifyDestroyed();
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -