my dog learned polymorphism
The moose likes Swing / AWT / SWT and the fly likes ImagePanel with components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "ImagePanel with components" Watch "ImagePanel with components" New topic

ImagePanel with components

Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
I have created a panel that displays a background image as below:-

But I need to add components to it. I'm doing this:-

Problem is, whilst I see the background image and don't see the buttons.

Do I need to change the ImagePanel class or something?

Cheers in advance!
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2454
Don't use a "null layout". Why did you include that line if you don't know what it does?

Also, there is no need to create a custom component for this, you can just use a JLabel and then set the desired layout manager.
I agree. Here's the link:
subject: ImagePanel with components
It's not a secret anymore!