| Author |
resizing background on JPanel with window
|
Andy Ranangnai
Greenhorn
Joined: Aug 11, 2009
Posts: 16
|
|
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!
|
C:\DOS
C:\DOS.RUN
RUN.DOS.RUN
|
 |
Andy Ranangnai
Greenhorn
Joined: Aug 11, 2009
Posts: 16
|
|
bump? Maybe this isn't possible?
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8441
|
|
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
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8441
|
|
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
Joined: Aug 11, 2009
Posts: 16
|
|
|
Perfect, thanks a bunch.
|
 |
 |
|
|
subject: resizing background on JPanel with window
|
|
|