This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

resizing background on JPanel with window

 
Andy Ranangnai
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all, I was wondering if someone could explain how I might get my background image I have painted onto a JPanel to stretch (or contract) to fit the panel and resize with it. It doesn't seem like it should be difficult but I haven't found a way to phrase it for Google yet....

Thanks!
 
Andy Ranangnai
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bump? Maybe this isn't possible?
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andy,
We have a forum dedicated for Swing. I will move this post there for you.
In future, please choose your forums carefully. You stand a better chance of getting help that way.

Also, please read this
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this out
http://faq.javaranch.com/java/BackgroundImageOnJPanel

As you can see, you need to define the dimensions of the image, to match the dimensions of the parent container (panel in this case)
 
Andy Ranangnai
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perfect, thanks a bunch.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic