thank you so much the previous reply.
here i have another problem.i wanted to have image img1 as background and img2 as a forground.
at present with the below code, it produces strange result. image img1 come as a background but img2 it does not come on the forground yet it show the space of img2 containing the img1 image.
please help me.
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class popo1 extends
Applet {
Image img1,img2;
public void init()
{
MediaTracker mt=new MediaTracker(this);
/*img1 image file is big and covers all the appletspace, where as the
img2 image is small and it should stay like on top of the image img1 file.
in a nutshell..img1 as a background and img2 as forground.
*/
img1=getImage(getDocumentBase(),"d.gif");
img2=getImage(getDocumentBase(),"language.gif");
mt.addImage(img1,1);
mt.addImage(img2,2);
try
{
mt.waitForAll();
}
catch(InterruptedException e)
{}
}
public void paint(Graphics g)
{
g.drawImage(img1,0,0,this);
g.drawImage(img2,20,40,this);
}
}