aspose file tools*
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.
It is sorta covered in the JavaRanch Style Guide.
subject: Image as a background