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 image as background to jpanel 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 background to jpanel" Watch "image as background to jpanel" New topic

image as background to jpanel

Chris Dancy
Ranch Hand

Joined: Feb 14, 2006
Posts: 136
hey guys quick question. say i have an image fish.jpg and JPanel panel = new JPanel();

how do i set the background of the JPanel to fish.jpg?

is there a quick and easy way?

("Anger is not an emotion, its a symptom of fear.")
Tim LeMaster
Ranch Hand

Joined: Aug 31, 2006
Posts: 226
This is asked often enough is part of the FAQ.
I agree. Here's the link:
subject: image as background to jpanel
It's not a secret anymore!