?? bouncingmidlet.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 + -