This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JPanel and ImageBackground ?" Watch "JPanel and ImageBackground ?" New topic
Author

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.
Thanks...


yours respectfully<br />Avin Sinanan
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

You would make a JPanel something like this...



-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
Consider Paul's rocket mass heater.
 
subject: JPanel and ImageBackground ?
 
Similar Threads
Image as a background
Move an image across a screen ?
Transparancy
Setting JCanvas background to an image?
To Display background image in a Jframe/JPanel