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

📄 bouncingmidlet.java

📁 Bounce ball on mobile phone J2ME Happy Coding :)
💻 JAVA
字号:
/*
 * BouncingMidlet.java
 * Andreas Jakl
 */

package Bounce;

import java.util.Timer;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class BouncingMidlet extends MIDlet
{
    private Display display;
    private BouncingCanvas canvas;
    private BouncingBall ball;
    private Timer tm;
    private boolean firstStart = true;
    
    public BouncingMidlet()
    {
	display = Display.getDisplay(this);
	ball = new BouncingBall();
	canvas = new BouncingCanvas(this, ball);
	
	tm = new Timer();
    }
    
    public void startApp ()
    {
	if (firstStart)
	{
	    Timer tm = new Timer();
	    tm.schedule(new BouncingTimerTask(canvas, ball), 50, 50);
	    display.setCurrent (canvas);
	    firstStart = false;
	}
    }
    
    public void pauseApp ()
    {
    }
    
    public void destroyApp (boolean unconditional)
    {
    }
    
    public void exitMIDlet()
    {
	destroyApp(true);
	notifyDestroyed();
    }
}

⌨️ 快捷键说明

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