java blog

java boy

常用链接

统计

最新评论

黑屏白字 SimpleCanvas


import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;


public class SimpleCanvas extends MIDlet{
  private Display display;

    public SimpleCanvas() {
        display=Display.getDisplay(this);

    }
 
    protected void destroyApp(boolean unconditional)  {
     
       
    }

    protected void pauseApp() {
       
    }

    protected void startApp(){
     MyCanvas mc=new MyCanvas();
     display.setCurrent(mc);
    }


}
class MyCanvas extends Canvas {

    public void paint(Graphics g){
      g.setColor(0,0,0);
      g.fillRect(0,0,getWidth(),getHeight());
      g.setColor(255, 255,255);
      g.drawString("你好,测试", 100, 100, 0);
    }

}

posted on 2009-11-26 20:06 javaz 阅读(195) 评论(0)  编辑  收藏 所属分类: javaME


只有注册用户登录后才能发表评论。


网站导航: