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 and ImageBackground ? 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 and ImageBackground ?" Watch "JPanel and ImageBackground ?" New topic

JPanel and ImageBackground ?

Avin Sinanan
Ranch Hand

Joined: Nov 07, 2001
Posts: 109
Hello I am building an apllication. I need to know how to set the background of a JPanel to am image. I already know how to set the background to a color. I need to know how to set it to a Gif file. lets say the gif file is fish.gif
Anyone know how to do this. It must be a JPanel..not a JFrame.

yours respectfully<br />Avin Sinanan
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

You would make a JPanel something like this...


Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: JPanel and ImageBackground ?
It's not a secret anymore!