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

📄 rotatingcube.java

📁 3D J2ME 代码集合
💻 JAVA
字号:
import javax.microedition.midlet.*;import javax.microedition.lcdui.*;import java.util.*;// Our custom MIDlet public class RotatingCube extends MIDlet{    static RotatingCube instance;    MyCanvas displayable = new MyCanvas(); // Custom Canvas does 3D graphics    Timer iTimer = new Timer();    // Timer to implement animation    // MIDlet's constructor    public RotatingCube() {        this.instance = this;    } // end constructor    // Main entry point    public void startApp() {        Display.getDisplay(this).setCurrent(displayable);        iTimer.schedule( new MyTimerTask(), 0, 40 ); // Start timer    } // end startApp()    // Manage pausing the MIDlet    public void pauseApp() {    } // end pauseApp    // Manage terminating the MIDlet    public void destroyApp(boolean unconditional) {    } // end destroyApp()    // Quit the MIDlet, doing any clean-up before calling destroyApp()    public static void quitApp() {        instance.destroyApp(true);        instance.notifyDestroyed();        instance = null;    } // end quitApp()    // Our timer task for providing animation    class MyTimerTask extends TimerTask {        public void run() {            if( displayable != null ) { // If Canvas is present...                displayable.repaint(); // ... call its repaint()            } // end if        } // end run    } // end TimerTask} // end MIDletMain

⌨️ 快捷键说明

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