This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "image as background to jpanel" Watch "image as background to jpanel" New topic
Author

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.

http://faq.javaranch.com/view?BackgroundImageOnJPanel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: image as background to jpanel
 
Similar Threads
Image as a background
Adding a picture
how to make an image my jpanel background
add background image in JPANEL
JPanel background image