File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Background images for the Frame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Background images for the Frame" Watch "Background images for the Frame" New topic

Background images for the Frame


Joined: Oct 18, 2001
Posts: 2
Hi, can somebody tell me how can i insert a background image in my application? tanks!
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

You'll have to make a specialized component ( like JImagePanel below... ) that can paint a graphic in the background. Then, you'll add that component to your frame, and add any new components to it.


Write once, run anywhere, because there's nowhere to hide! - /. A.C.
john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
add your image to a JLabel, make the label the size u
wish, add the label last in your list of items being
added to your frame and make sure to make setOpaque(false)
in regards to your other components
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

Almost forgot....

Please re-register with a name that follows the guidelines of the JavaRanch naming conventions. We require all registered user names to be in the form "first name" + space + "last name". Thanks!
I agree. Here's the link:
subject: Background images for the Frame
It's not a secret anymore!