This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Adjusting image size to image label Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Adjusting image size to image label" Watch "Adjusting image size to image label" New topic
Author

Adjusting image size to image label

Tristan Van Poucke
Ranch Hand

Joined: Jun 30, 2008
Posts: 47
I have an Imagelabel wich shows a particular image.
At the moment it only shows a part of the image, because the images I want it to show are mostly bigger than the label I use to show them in.
How can I show the image in the same size as the imagelabel?
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 687
    
    1
If you use the drawImage() method, you can scale the image to your requirements.
Otherwise post the relevant code to show how you are doing it.
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
 
jQuery in Action, 2nd edition
 
subject: Adjusting image size to image label