📄 scroll3d.java
字号:
import java.io.IOException;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
/**
* Shows how to use two Layers of background moving at different speed,
* to create a sense of 3D.
*
* This code is part of the Tips & Tricks section at
* www.SonyEricsson.com/developer
*
* Written by J鰊s Weimarck, 2004
*/
public class Scroll3D extends MIDlet implements CommandListener {
private Display display;
private ScrollCanvas scrollCanvas;
private Command exitCommand;
public void startApp() {
try {
scrollCanvas = new ScrollCanvas();
exitCommand = new Command("Exit", Command.EXIT, 0);
scrollCanvas.addCommand(exitCommand);
scrollCanvas.setCommandListener(this);
display = Display.getDisplay(this);
display.setCurrent(scrollCanvas);
scrollCanvas.start();
}catch (IOException ioe) {
System.out.println(ioe.getMessage());
}
}
public void commandAction(Command c, Displayable d) {
if (c.getCommandType() == Command.EXIT) {
destroyApp(true);
notifyDestroyed();
}
}
public void destroyApp(boolean unconditional) {
scrollCanvas.stop();
}
public void pauseApp() {}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -