Java Swing JLabel how to resize image to fit the size of jlabel

Java Swing JLabel how to resize image to fit the size of jlabel
refe‮tual:ot r‬turi.com
JLabel label = new JLabel("Printer");
label.setBounds(100, 100, 100, 40);

ImageIcon imageIcon = new ImageIcon(new ImageIcon("printicon.png").getImage().getScaledInstance(32, 32, Image.SCALE_DEFAULT));
label.setIcon(imageIcon);
Created Time:2017-10-07 22:03:13  Author:lautturi