--- old/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java 2012-03-23 20:16:26.000000000 +0400 +++ new/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java 2012-03-23 20:16:25.000000000 +0400 @@ -735,9 +735,17 @@ return null; } - // TODO: need a walk-through to find the best image. - // The best mean with higher resolution. Otherwise an icon looks bad. - final Image image = icons.get(0); + // Choose the best (largest) image + Image image = icons.get(0); + // Assume images are square, so check their widths only + int width = image.getWidth(null); + for (Image img : icons) { + final int w = img.getWidth(null); + if (w > width) { + image = img; + width = w; + } + } return CImage.getCreator().createFromImage(image); }