Short answer, you can't. The icon size of a window is controlled by the window mananger which runs the application. Some windows managers don't even show an icon.
You can provide alternative icons with different sizes (see method setIconImages()
), but the windows manager will decide which icon will be displayed. See javadoc:
public void setIconImages(List<? extends Image> icons)
Sets the sequence of images to be displayed as the icon for this window. Subsequent calls to getIconImages will always return a copy of the icons list.
Depending on the platform capabilities one or several images of different dimensions will be used as the window's icon.
The icons list is scanned for the images of most appropriate dimensions from the beginning. If the list contains several images of the same size, the first will be used.
Ownerless windows with no icon specified use platfrom-default icon. The icon of an owned window may be inherited from the owner unless explicitly overridden. Setting the icon to null or empty list restores the default behavior.
Note : Native windowing systems may use different images of differing dimensions to represent a window, depending on the context (e.g. window decoration, window list, taskbar, etc.). They could also use just a single image for all contexts or no image at all.