I tried to display an Image
in applet window but it's not working. I have placed the image in the same directory of the applet file.
Here is my sample code
import java.applet.Applet;
import java.awt.Image;
import java.awt.Graphics;
public class Animation extends Applet{
Image img;
public void init(){
img=getImage(getDocumentBase(),"images.jpg");
}
public void paint(Graphics g){
g.drawImage(img, 40, 60, this);
g.drawString("This is first step", 10, 30);
}
}