my dog learned polymorphism
The moose likes Swing / AWT / SWT and the fly likes  set the background of a JPanel with an image Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark " set the background of a JPanel with an image" Watch " set the background of a JPanel with an image" New topic
Author

set the background of a JPanel with an image

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
condsider this:

JPanel p = new JPanel();
p.setBackground(Color.GREEN);

is there anyway to set the background to an image?

I'm looking from some more living colors other than the spectrum provided by swing.

thanks
ppr
Stuart Gray
Ranch Hand

Joined: Apr 21, 2005
Posts: 410
I don't think so, but you could maybe fudge it using an ImageIcon.
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281


java amateur
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: set the background of a JPanel with an image
 
Similar Threads
To Display background image in a Jframe/JPanel
setting background image in applet
image as background to jpanel
JPanel background image
How to add backgroung image to JPanel?