+ // set window icons of different resolutions (1.6+)
+ try
+ {
+ ArrayList<Image> icons = new ArrayList<Image>();
+ String[] resolutions = {"_16", "_20", "_32", "_64", "_128"};
+ for (String r : resolutions) {
+ icons.add(IconManager.getImageIcon(IconManager.WINDOW_ICON + r + ".png").getImage());
+ }
+ Class<?> d = java.awt.Window.class;
+ // This is the same as frame.setIconImages(icons) but is compilable also for java1.5 where this isn't available
+ d.getDeclaredMethod("setIconImages", new Class[]{java.util.List.class}).invoke(frame, icons);
+ }
+ catch (Exception e)
+ {
+ // setting a list of icon images didn't work, so try with just one image instead
+ try {
+ frame.setIconImage(IconManager.getImageIcon(IconManager.WINDOW_ICON + "_16.png").getImage());
+ }
+ catch (Exception e2) {}