File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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: 15286
    
    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 - A Test Data Generation Platform
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Background image
 
Similar Threads
JPanel background image
DISPLAY an IMAGE
awt
swing
Stretch the image size.