Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JPanel has white background when painted in a buffered image

boomahMar 7 2008 — edited Mar 7 2008
Hi people. Please help me before I go nuts!

I've got a program that creates some components, creates a buffered image, draws the components onto the buffered image and then draws the buffered image somewhere on screen.

This all works fine apart from one really annoying problem. When I'm drawing a JPanel, the background (or the place where it doesn't contain any other components) is white!

If I use a JComponent it all works fine. I can see the component underneath, however, I need to draw some components that I don't have control over and they are based on a JPanel.

I set the JPanel's setOpaque to false but still the background is white.

This is driving me crazy as I've tried lots of different techniques to get this to work but it just won't.

Please Help,

Paul.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 4 2008
Added on Mar 7 2008
9 comments
1,229 views