This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes image scaling on window resize Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply locked New topic
Author

image scaling on window resize

chop ficaro
Ranch Hand

Joined: May 02, 2010
Posts: 30
can i make an image scale to fit the window with BorderLayout.CENTER?
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2090
    
    7
You need to do custom painting to scale the image on the fly. BackgroundPanel shows one way to do this.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4522
    
    5

Apparently continued here without the courtesy of acknowledging Rob's help.
http://www.coderanch.com/t/508226/GUI/java/BackgroundPanel-java-cannot-placed-BorderLayout


luck, db
There are no new questions, but there may be new answers.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

Chop, please Use One Thread Per Question. I'm going to close this thread; we can continue in the other one.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: image scaling on window resize
 
Similar Threads
rewriting the browser contents using Struts
AWT Window with background
Don't repaint?
Nice 2D graphics?
Image while loading a page