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 JPanel 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 "JPanel background image" Watch "JPanel background image" New topic

JPanel background image

Sergei Voropay
Ranch Hand

Joined: Feb 20, 2001
Posts: 31
Is it possible to set an image as a background for JPanel. If possible, how?
John Zukowski
Ranch Hand

Joined: Mar 29, 2001
Posts: 88
Yes. Override paintComponent(). I actually have this example in my book....
John Zukowski Author of "Definitive Guide to Swing for Java 2" and "Java Collections"

John Zukowski Author of <a href="" target="_blank" rel="nofollow">"Definitive Guide to Swing for Java 2"</a>,<br /><a href="" target="_blank" rel="nofollow">"Java Collections"</a> and <a href="" target="_blank" rel="nofollow">"Learn Java with JBuilder 6"</a>
I agree. Here's the link:
subject: JPanel background image
jQuery in Action, 3rd edition