listing11-04_mygamecanvas.java_overridingpaint
来自「着几乎所有智能机厂商都将有自己配套的App Store,甚至并非智能手机制造商的」· JAVA_OVERRIDINGPAINT 代码 · 共 29 行
JAVA_OVERRIDINGPAINT
29 行
// if you need to override the paint() method, you need to
// override paintScreen() instead when the J2ME Polish GUI is
// used - but only on MIDP 1.0 devices:
import javax.microedition.lcdui.game.GameCanvas;
import javax.microedition.lcdui.Graphics;
public class MyGameCanvas
extends GameCanvas
implements Runnable
{
public MyGameCanvas(boolean supress) {
super(supress);
}
public void run() {
// main game loop
}
//#if polish.usePolishGui && polish.classes.fullscreen:defined && !polish.midp2
//# public void paintScreen( Graphics g )
//#else
public void paint( Graphics g )
//#endif
{
// implement the paint method
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?