08-16-2017, 10:24 PM
Code:
import java.awt.*;
import java.applet.*;
/*
<applet code=ImageLoad width=300 height=300>
<param name="img" value="smile.jpg">
</applet>
*/
public class ImageLoad extends Applet
{
Image img;
public void init()
{
img = getImage(getDocumentBase(), getParameter("img"));
}
public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h)
{
if((flags & ALLBITS) == 0 )
{
System.out.println("Still processing the image");
return true;
}
else
{
System.out.println("Done processing the image");
}
}
public void paint(Graphics g)
{
g.drawImage( img, 0, 0, this);
}
}