This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes draw image on JDesktopPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "draw image on JDesktopPane" Watch "draw image on JDesktopPane" New topic

draw image on JDesktopPane

Michael Remijan
Ranch Hand

Joined: May 29, 2002
Posts: 128

I have a gif that I want to setup as the "background" of a JDesktopPane object. Any ideas how to do this?

Java EE Evangelist — Author, EJB 3 in Action 2nd Edition — Java Community Process Member
Rene Liebmann
Ranch Hand

Joined: May 02, 2002
Posts: 196
First you have to create your own DesktopPane, which extends from JDesktopPane. Then you have to overwrite the paintComponent(Graphis g) method, where you draw your image.
One year ago I found a JavaAPI called KIWI. This API was free to use. You will find it here.
I think, they provide the same functionality, which you want to have, but if you want to do it by your own, you will find a good example.
Hope that helps

Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

I posted how to do this ( with code ), in this post...

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: draw image on JDesktopPane
It's not a secret anymore!