kPxrMHEY1Xt3I8U的ChinaUnix博客
kPxrMHEY1Xt3I8U
全部博文(757)
2011年(1)
2008年(756)
cynthia
格伯纳
浪花小雨
ballzb
分类:
2008-09-09 12:38:01
public class BlocksCanvas extends Canvas implements Runnable { Graphics bg; Image buf; public BlocksCanvas() { ...... height = getHeight(); width = getWidth(); //按屏幕大小建立缓冲对象 buf = Image.createImage(width, height); //将缓冲对象的Graphics附给bg bg = buf.getGraphics(); ...... } public void run() {...... for(i=0;i
public class BlocksCanvas extends Canvas implements Runnable { private boolean stopFlag=false;//调试标志 ...... public void run() { //断点位置1 testFun(“x:”+x+“y:”+y); ...... //断点位置2 testFun(“”); ...... } private void testFun(String str) { stopFlag=true; //画一个白色长方形 bg.setGrayScale(255); bg.fillRect(0,0, fontW, fontH); //在白色长方形上显示str的内容 bg.setGrayScale(0); bg.drawString(str, 0,0, Graphics.TOP | Graphics.LEFT); repaint(); while(stopFlag){} } public void keyPressed(int keyCode) { stopFlag=false; } }
[1]
上一篇:端到端J2ME应用开发实例——介绍Smart Ticket
下一篇:J2ME专业手机游戏开发基础
登录 注册