resize image icon to fit jlabel

Solutions on MaxInterview for resize image icon to fit jlabel by the best coders in the world

showing results for - "resize image icon to fit jlabel"
Lara
18 Mar 2019
1ImageIcon imageIcon = new ImageIcon(new ImageIcon("icon.png").getImage().getScaledInstance(20, 20, Image.SCALE_DEFAULT));
2label.setIcon(imageIcon);
3