?? worldtest.java
字號:
import net.jscience.math.kvm.MathFP;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.io.IOException;
public class WorldTest extends MIDlet implements CommandListener, Runnable
{
private GameScreen gameScreen;
private Command quit;
private boolean running;
public WorldTest()
{
// Construct a canvas
gameScreen = new GameScreen();
// And a way to quit
quit = new Command("Quit", Command.EXIT, 2);
gameScreen.addCommand(quit);
gameScreen.setCommandListener(this);
running = true;
Thread t = new Thread(this);
t.start();
}
public void run()
{
while (running)
{
gameScreen.repaint();
gameScreen.cycle();
try
{
Thread.sleep(100);
}
catch (InterruptedException e)
{
}
}
}
protected void startApp() throws MIDletStateChangeException
{
Display.getDisplay(this).setCurrent(gameScreen);
}
protected void pauseApp()
{
}
protected void destroyApp(boolean unconditional)
throws MIDletStateChangeException
{
}
public void commandAction(Command command, Displayable displayable)
{
try
{
if (command == quit)
{
running = false;
destroyApp(true);
notifyDestroyed();
}
}
catch (MIDletStateChangeException me)
{
System.out.println(me + " caught.");
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -