size change automatically image icon jbutton java code example
Example: resizing ImageIcon in JButton java
Image img = icon.getImage();
Image newimg = img.getScaledInstance(NEW_WIDTH, NEW_HEIGHT, java.awt.Image.SCALE_SMOOTH);
icon = new ImageIcon(newimg);