⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imagetestappletwithsmoothdynamicupdate.java

📁 awt图形界面的生成
💻 JAVA
字号:
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Image;

public class ImageTestAppletWithSmoothDynamicUpdate extends Applet {
 	private Image im;

	public void init() {
		im = getImage(getCodeBase(), "saint.gif");

		System.out.print  ("Image width=" + im.getWidth(this));
		System.out.println(" height=" + im.getHeight(this));
	}
	public void paint(Graphics g) {
	  g.drawImage(im,0,0,this);
	}
	public boolean imageUpdate(Image image, int flags, 
							   int x, int y, int w, int h)
	{
 		System.out.println("imageUpdate():  x=" + x + ", y=" + 
		                    y + "  w=" + w + ",h=" + h);
		repaint();

		if((flags & ALLBITS) == 0)  
			return true;			// need more updates 
		else  
			return false;			// image is fully loaded
	}
	public void update(Graphics g) {
		paint(g);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -