Damn you Swing!

Ok, i’ve made a variety of panels which ive put onto my frame. The problem is everything is gray! I used paintcomponent to put a nice background in and the damn thing doesnt show up! Help please? ??? ???

do u use super.paint(g)?

layout used?

c-an you give some more info

class OpeningScreen extends JFrame implements ActionListener{
Image BackGround = Toolkit.getDefaultToolkit().getImage(“BackGroundOpen.gif”);
JPanel TeamPanel = new JPanel(); Border b1 = BorderFactory.createTitledBorder(“Choose Your Team”);
JPanel HostPanel = new JPanel(); Border b2 = BorderFactory.createTitledBorder(“Are you Host?”);
JPanel PlayPanel = new JPanel(); Border b3 = BorderFactory.createTitledBorder(“Play!”);
Box LabelPanel = Box.createVerticalBox();
boolean bool = false;
JButton RED = new JButton(“Red Team”); JButton BLUE = new JButton(“Blue Team”);
JButton Host = new JButton(“Host”); JButton Leech = new JButton(“Leech”);
JButton Play = new JButton(“Play!”);
JLabel QHost = new JLabel(); JLabel QTeam = new JLabel();
char OpeningTeam = ’ ';
char OpeningHost = ’ ';
Test t;

OpeningScreen(){
	Play.addActionListener(this);
	RED.addActionListener(this);
	BLUE.addActionListener(this);
	Host.addActionListener(this);
	Leech.addActionListener(this);
	Font f = new Font("Comic Sans MS", Font.PLAIN, 30);
	Color c = Color.BLUE;
	PlayPanel.setLayout(new BorderLayout());
	HostPanel.setBorder(b2); TeamPanel.setBorder(b1); PlayPanel.setBorder(b3);
	PlayPanel.add(Play, BorderLayout.CENTER);
	HostPanel.add(Host); HostPanel.add(Leech);
	TeamPanel.add(RED); TeamPanel.add(BLUE);
	QHost.setFont(f); QTeam.setFont(f);
	QHost.setForeground(c); QTeam.setForeground(c);
	//LabelPanel.add(Box.createHorizontalStrut(1));
	LabelPanel.add(Box.createRigidArea(new Dimension(30,60)));
	LabelPanel.add(QHost);
	LabelPanel.add(Box.createVerticalStrut(20));
	LabelPanel.add(QTeam);
	this.setSize(400,400);
	this.setLayout(new BorderLayout());
	this.add(HostPanel, BorderLayout.NORTH);
	this.add(TeamPanel, BorderLayout.SOUTH);
	this.add(PlayPanel, BorderLayout.EAST);
	this.add(LabelPanel, BorderLayout.CENTER);
	this.setVisible(true);
}

 //public void paintComponent(Graphics g) {
 ///	g.drawImage(BackGround,10,10,this);
 //}


public void actionPerformed(ActionEvent e){
	if(e.getSource() == Play){bool = true;t = new Test();}
	if(e.getSource() == RED){QTeam.setText("Red  ");OpeningTeam = 'R';}
	if(e.getSource() == BLUE){QTeam.setText("Blue ");OpeningTeam = 'B';}
	if(e.getSource() == Host){QHost.setText("Host ");OpeningHost = 'H';}
	if(e.getSource() == Leech){QHost.setText("Leech");OpeningHost = 'L';}
}

here is the code. i know it probaly sucks, but its for a final project, and i need to get that damn image there!Thanks

is it an image with transparant parts?

try adding super.paint(g);
to paint method

If this is really for a final project my first advice would be: please adhere to the java coding conventions. Identifiers should start with lower case letters. Also, your paintComponent method is obviously commented out. Third, if you add a large number of panels to to frame they will cover it. Therefore it doesn’t matter what you draw in the paintComponent method, since the nontransparent panels will simply be drawn there instead.

Ok, thanks for the advice. It is only commented out because i was working on it without the image at the time i copied and pasted it. Not an error, i assure you.
How do i make an image semi-transparent?

I suppose what you want is to make the backgrounds of those PANELS transparent. That is done by calling .setOpaque(false). If you still want to tinker with images, check out java.awt.Transparency.