Hello,
The following applet displays two .jpg files (ImageIcon objects - x and y) on a JPanel. I would like to display the second ImageIcon object (y) as transparent. Is that possible?
Thank you!
import javax.swing.*;
import java.awt.*;
public class PicPanel extends JApplet
{
ImageIcon x, y;
JPanel panel;
public void init()
{
x = new ImageIcon("image0.jpg");
y = new ImageIcon ("image1.jpg");
panel = new JPanel();
add(panel);
}
public void paint(Graphics g)
{
g.drawImage (x.getImage(), 0, 0, x.getIconHeight(), x.getIconWidth(), panel);
g.drawImage (y.getImage(), 100, 100, y.getIconHeight(), y.getIconWidth(), panel);
}
}