I currently studying the java swing builder as a new tech skills. I need to study how to import the image on my canvas. Yes it successfully imported and the image clearly define and not blurry. however when I run the project the image that I import to the project it goes blurry. I don't know why it happens. I research some functionality like get scaled but nothing happens it goes same output it get blurry.
Image Dimension: 250x250
Here is my code that I implement on my project:
private Image doctor_ppe = new ImageIcon(LoginScreen.class.getResource("/assets/large.png")).getImage().getScaledInstance(250, 250, Image.SCALE_SMOOTH);
JLabel lblDds = new JLabel("");
lblDds.setVerticalAlignment(SwingConstants.BOTTOM);
lblDds.setHorizontalAlignment(SwingConstants.CENTER);
lblDds.setIcon(new ImageIcon(doctor_ppe));
lblDds.setBounds(59, 305, 236, 251);
panel.add(lblDds);
Difference of not runnable project and runnable project:
Image not blurry:
Image Blurry After I run the project:
Hope someone experience this, hope will help on my problem thank you.