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 Image as a background Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Image as a background" Watch "Image as a background" New topic

Image as a background

Abdullah Sheikh

Joined: Nov 27, 2000
Posts: 3
Can I use an JPEG or GIF image as a background in JPanel?
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
There is not a method in this class to set the background image for a JPanel. You will probably have to override paint() in your JPanel to achieve this. You may get some ideas from this discussion on Sun's web site.
I agree. Here's the link:
subject: Image as a background
It's not a secret anymore!