This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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
Author

Background image

Rocky Summers
Ranch Hand

Joined: Nov 07, 2003
Posts: 66
hey guys,
just wondering how i can add a background image in a swing program..
~ rockster
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302
    
    6

Rocky, if you search this forum you will find that this question has been asked and answered a LOT. But the gist of it is overriding the paintComponent(Graphics g) method of a Swing component (usually a JPanel) and drawing the image in that method. You can also just place an ImageIcon on a component but you will have problems placing other components on top of that. So the paintComponent is the way to go if you are looking for a wallpaper type of feature.


GenRocket - Experts at Building Test Data
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Background image
 
It's not a secret anymore!