wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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!
wood burning stoves
subject: Background images for the Frame
Similar Threads
background image in jasper report
how to use html tag <area> if the image is background image
CSS drop downs, scroll bars and text areas..
Want to come home to the US: should I?