Add a method setIconImages(Image images) to [J]Frame, [J]Dialog
For years there are debates why Java on the desktop doesn't catch on. One reason is that small things (from an engineering point of view) are still not fixed. These small things, however, make it impossible to polish a Java desktop application ad have a huge impact on how end-users perceive such an application: "They can't get this trifle cosmetic thing right, so how will things look under the hood"?
One of the things which are still not satsifying after almost a decade is how top-level window icons can be specified. In detail:
(a) [J]Frame just allows to provide one image via setIconImage(Image icon), which is then scaled in a platform-dependent way. This scaling usually results in rather ugly results if one didn't happen to accidentally provide the right size for a particular platform (this "right size" will of course fail on another platform).
The only solution - read "hack" - for a cross-platform application is to check the OS name on which it is running and select a different icon according to the name. But that hack still doesn't work on platforms where icons of different formats are used by the platform in different places and situations.
So, please make it possible that one can specify a list of potential icons, and the runtime selects these icon(s) from the list which best matches the platform's native icon size(s).
(b) Allow to specify an icon (or better yet the just suggested list of icons) for [J]Dialogs. This is also a feature which people miss for almost a decade in Java.
On platforms or PLAFs where dialogs are not supposed to be decorated with an icon the icon setting should silently be ignored.
(c) Add a method "Dimension getPreferedIconSizes()" to [J]Frame and [J]Dialog or the Toolkit, which responds with a list of icon sizes as preferred by the platform.
Such a method would facilitate the use of setIconImages() with a set of matching icons. Note, it should still be allowed to call setIconImages() "blindly" with a set of potentially not matching icons. In this case the runtime should pick the nearest matching icon and scale it to the desired size.
(d) Alternatively, consider adding callbacks to both [J]Frame and [J]Dialog which are called by the frame or dialog when the frame or dialog is in need of some icon. The argument to the callback should be the dimension of the requested icon. A frame or dialog should be allowed to call the registered callback any time, and with different dimensions.
(e) Consider to not only allow arguments of type Image, but also of type Icon.
(f) Consider deprecating the existing setIconImage(Image) method.