我是个新手,请帮忙看看这个程序错误在那里!!谢谢
import java.awt.*; import java.applet.*; public class BackgroundImage extends Applet { Image picture; Boolean ImageLoaded=false; public void init() { picture=getImage(getCodeBase(),"wx1.gif"); Image offScreenImage=createImage(size().width,size().height); Graphics offScreenGC=offScreenImage.getGraphics(); offScreenGC.drawImage(picture,0,0,this); } public void paint(Graphics g) { if (ImageLoaded) { g.drawImage(picture,0,0,null); showStatus("Done"); } else showStatus("Loading image"); } public boolean imageUpdate(Image img,int infoflags,int x,int y,int w,int h) { if(infoflags==ALLBITS) { ImageLoaded=true; repaint(); return false; } else return true; } }
这是一个双缓冲图象的程序演示,请帮忙看看!!