public class GetRGBCanvas extends Canvas { Image img; boolean ok; public GetRGBCanvas(){ setFullScreenMode(true); ok = false; try { int [] rgbArray = new int[15 * 15]; Image temp = Image.createImage("/enableSound.png"); temp.getRGB(rgbArray, 0, 15, 0, 0, 15, 15); img = Image.createRGBImage(rgbArray, 15, 15, true); ok = true; } catch (IOException e) { } } protected void paint(Graphics g) { // TODO Auto-generated method stub g.setColor(0); g.fillRect(0, 0 , 240, 310); if(ok){ g.drawImage(img, 120, 155, Graphics.HCENTER | Graphics.VCENTER); }else{ g.setColor(0xfffffff); g.drawString("NO OK!!", 120, 155, Graphics.HCENTER | Graphics.BOTTOM); } } }