• Post Reply Bookmark Topic Watch Topic
  • New Topic

set the background of a JPanel with an image  RSS feed

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think so, but you could maybe fudge it using an ImageIcon.
 
miguel lisboa
Ranch Hand
Posts: 1281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!