I would like to take an image file on disk and display it to fit the size of a jlabel (preserve aspect ratio)
the image can vary in size from 100x100 to 1600x1200 and the size of the jlabel is 256x192 (can change it only slightly if need be.)

I have looked up getScaledInstance on the net, and my befuddled brain cant wrap itself around it

thanks for any help.....

getScaledInstance - just pass it the desired width/height and a scaling method (use SCALE_DEFAULT if yo don't know). It returns a new Image that is the size you requested.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.