📄 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 + -