how to set an image as background for a jPanel in an applet
hi, I want to set an image as background for a jPanel component in an applet. I am using netbeans environment. I found that to set an image as a background for a jPanel is not possible. Could someone help me . Thanks in advance,Joshua
[262 byte] By [
joshuaRa] at [2007-10-3 3:47:02]

public class ImagePanel extends JPanel
{
private Image image = null;
public void setImage(Image image)
{
this.image = image;
}
protected void paintComponent(Graphics g)
{
super.paintComponent(g);
g.drawImage(this.image, 0, 0, this);
}
}
Adjust to taste.