954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How do you add a JPanel onto another JPanel that has graphics?

Hi! Basically what im trying to do is to add a JPanel onto another JPanel that has painted graphics on it using the paintComponent() method. But the JPanel I am trying to add is not shown because it is covered up by the JPanel w/ Graphics on it.

How can I make it so that when I add the JPanel to the one w/ graphics it will show the JPanel in the front instead of being covered up by the Graphics?

All answers are appreciated! :)

gordsmash
Newbie Poster
2 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
 

You could setOpaque(false); on the panel that you wish to be transparent. It depends on what layout you are using and how you are adding the components.

Ezzaral
Posting Genius
Moderator
15,986 posts since May 2007
Reputation Points: 3,250
Solved Threads: 847
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: