Hello people can anyone tell me how I place an image in an applet once someone has clicked the mouse.
I have already got an image drawn on the applet, imgBackground, and I want to place the image, imgZero, over the top of the image already there when someone clicks the mouse. Here is my code :
import java.applet.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class gameClass extends Applet implements ActionListener
{
private Image imgBackground, imgZero;
public void init()
{
imgBackground = getImage(getDocumentBase(), "Back.gif");
imgZero = getImage(getDocumentBase(), "zero.gif");
}
public void paint(Graphics g)
{
g.drawImage(imgBackground,0,0,this);
}
public void mouseClicked(MouseEvent event)
{
}
public void actionPerformed(ActionEvent event)
{
}
}