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);
}
}