final Icon icon = uiIcon.getIcon();
final int width = icon.getIconWidth();
final int height = icon.getIconHeight();
final BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
final Graphics2D g = image.createGraphics();
icon.paintIcon(null, g, 0, 0);
final Image scaledImage = image.getScaledInstance((int) (width * zoom), (int) (height * zoom),
Image.SCALE_SMOOTH);
zoomedIcon = new ImageIcon(scaledImage);
icons.put(zoom, zoomedIcon);
g.dispose();