ΪʲôͼƬ²»ÏÔʾ£¿
import java.applet.Applet;import java.awt.Graphics;
import java.awt.Image;
@SuppressWarnings("serial")
public class BackgroundImage extends Applet{
Image picture;
boolean ImageLoaded=false;
@SuppressWarnings("deprecation")
public void init(){
picture=getImage(getCodeBase(),"F:\\ͼƬ\\21.jpg");
Image offscreeImage=createImage(size().width, size().height);
Graphics offscreenGC=offscreeImage.getGraphics();
offscreenGC.drawImage(picture, 0, 0, this);
ImageLoaded=true;
}
public void paint(Graphics g){
if(ImageLoaded){
showStatus("Done");
}else
showStatus("Loading image");
}
public boolean imageUpdate(Image img,int infoflages,int x,int y,int w,int h){
if(infoflages==ALLBITS){
ImageLoaded=true;
repaint();
return false;
}else
return true;
}
}