import javax.microedition.lcdui.*; class DoubleBuf extends Canvas { private Image OffImage; DoubleBuf() { OffImage = Image.createImage(getWidth(), getHeight()); } public void paint(Graphics g) { offPaint(OffImage.getGraphics()); g.drawImage(OffImage, 0, 0, g.LEFT|g.TOP); } private void offPaint(Graphics g) { g.setColor(0); g.fillRect(0, 0, getWidth(), getHeight()); g.setColor(0x00ffffff); g.drawString("DoubleBuffer!", 0, 0, g.LEFT|g.TOP); } }