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

📄 gamemidlethold.java

📁 《j2me开发精解〉(詹健飞)CD-rom附带源码。用netbeans
💻 JAVA
字号:
package com.j2medev.chapter5.example;

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class GameMIDletHold extends MIDlet {
    static GameMIDletHold instance;
    
    static Display display;
    
    private GameScreenHold gameScreen;
    
    public GameMIDletHold() {
        instance = this;
        gameScreen = new GameScreenHold(false); //产生实例
        display = Display.getDisplay(this);
    }
    
    protected void startApp() throws MIDletStateChangeException {
        gameScreen.start();// 启动线程
        display.setCurrent(gameScreen);
    }
    
    protected void pauseApp() {
        gameScreen.stop();// 停止线程
    }
    
    public void destroyApp(boolean flag) throws MIDletStateChangeException {
        gameScreen.stop();// 停止线程
    }
}

⌨️ 快捷键说明

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