Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Swing / AWT / SWT and the fly likes background image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "background image" Watch "background image" New topic

background image

Ramiro Santos

Joined: Feb 19, 2004
Posts: 2
I'm having some trouble putting a background image on a frame using SWING.
What I have done is to create a panel that takes the entire frame or dialog and then a JLabel which I add to the panel. This label only contains an image that occupies the background. Afterwords I add my other panels to the JLabel and make them trasparent. I find it strange to add panels to a jlabel and so I guess there must be some other way. Any ideas?
Second, I'm having some problems resizing the image in function of the size of the display. Someone know how this can be done?
Thanks a lot
Carlos Failde
Ranch Hand

Joined: Oct 20, 2000
Posts: 84

I agree. Here's the link:
subject: background image
jQuery in Action, 3rd edition