Reducing image size in a combobox for proper fitting and/or to my specification

How to reduce an image size in a combobox for proper fitting and/or to my specification
Vanavah EdwardsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vanavah EdwardsAuthor Commented:
I am reviewing them now.
0
Vanavah EdwardsAuthor Commented:
I review all the others but the easiest one with the least code that worked in my class is the first one.
http://stackoverflow.com/questions/2856480/resizing-a-imageicon-in-a-jbutton
Only 3 lines of code below.  There is one point to consider, when you reduce the image size the comboxbox if set to a particular size will remain bigger than the image.  To make the combobox the same size as the image automatically set the  "renderer.setPreferredSize(null);" to null for the combobox.
Thank you very much you have been so helpful and save me alot of time.  I appreciate your efforts.  I will now award you and put some more quesitions out.
Image img = images[i].getImage();   
Image newimg = img.getScaledInstance(50,50, java.awt.Image.SCALE_SMOOTH); // where 50,50 is the width,height
images[i] = new ImageIcon(newimg);

Open in new window

0
for_yanCommented:
Great!
You are always welcome.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.