nickcherryjiggz
April 21st, 2007, 01:39 PM
I'm pretty new to Java, so sorry if this is a dumb question. I'm trying to make a JPanel semi-transparent. I have the class playPanel.java...
import java.awt.*;
import javax.swing.*;
public class playPanel extends JPanel
{
int blockType;
public playPanel()
{
super();
setLayout(null);
}
}...and from another class, gameFrame.java, I create a new playPanel...
pp = new playPanel();
pp.setBounds((int)(appWidth * .5 - playWidth * .5), (int)(appHeight * .5 - playHeight * .55 - 10), playWidth, playHeight);
getContentPane().add(pp);Is there an easy way to change the alpha of pp?
import java.awt.*;
import javax.swing.*;
public class playPanel extends JPanel
{
int blockType;
public playPanel()
{
super();
setLayout(null);
}
}...and from another class, gameFrame.java, I create a new playPanel...
pp = new playPanel();
pp.setBounds((int)(appWidth * .5 - playWidth * .5), (int)(appHeight * .5 - playHeight * .55 - 10), playWidth, playHeight);
getContentPane().add(pp);Is there an easy way to change the alpha of pp?