import javax.microedition.lcdui.Canvas; import javax.microedition.lcdui.Graphics; public class HelloCanvas extends Canvas { private int w= getWidth(); private int h=getHeight(); protected void paint(Graphics g){ g.setColor(255,255,117); g.fillRect(0,0,w,h); g.setColor(183,183,187); g.drawString("Hello,World !",w/2+2,h/3+2,Graphics.HCENTER| Graphics.TOP); g.setColor(213,34,9); g.drawString("Hello,World !",w/2,h/3,Graphics.HCENTER| Graphics.TOP); g.setColor(47,19,202); g.drawRect(10,h/3-h/4,w-20,h/3+h/4); } }