Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile 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: 11021
12
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: 11021
12
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