⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imageitemmidlet.java

📁 j2me接口的例子,很不错的东东 可以做教程
💻 JAVA
字号:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class ImageItemMIDlet extends MIDlet implements CommandListener {

    private Command exitComm;

    private ImageItem imageItem;
    private Image aImage;

    private Display display;

    public ImageItemMIDlet() {
        display = Display.getDisplay(this);

        exitComm = new Command("离开", Command.EXIT, 1);

        try {
            aImage = Image.createImage("/JavaPowered.png");
        } catch (Exception e) {}
        ;

        imageItem = new ImageItem("display image", aImage, ImageItem.LAYOUT_CENTER,
                                  "java");
    }

    public void startApp() {
        Form aForm = new Form("ImageItem示范");

        aForm.append(imageItem);

        aForm.addCommand(exitComm);

        aForm.setCommandListener(this);
        display.setCurrent(aForm);
    }

    public void pauseApp() {}

    public void destroyApp(boolean unconditional) {}

    public void commandAction(Command c, Displayable s) {
    	String comm = c.getLabel();
    	
        if (comm.equals("离开")) {
            destroyApp(false);
            notifyDestroyed();
        }
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -