static ImageIcon resizeImageIcon(ImageIcon icon, int newW) { var img = icon.getImage(); int newH = iround(img.getHeight(null)*(double) newW/img.getWidth(null)); ret imageIcon(resizeImage_raw(img, newW, newH, Image.SCALE_DEFAULT)); }