I have JPanel Which will load images.
Since images will not have the same width and height as the JPanel, I want to make the image resize and fit in the JPanel.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Read on this article, The Perils of Image.getScaledInstance()
Now IF you STILL prefer you can use something like,
this before loading the image to your JPanel, probably like discussed in this answer.