<AWT Dev> <Swing Dev> [10] Review request for 8182043: Access to Windows Large Icons

Alexey Ivanov alexey.ivanov at oracle.com
Fri Oct 6 16:53:29 UTC 2017

Hi Sergey,

Sorry for a long delay…

On 29/09/2017 20:29, Sergey Bylokhov wrote:
> On 9/29/17 07:34, Alexey Ivanov wrote:
>>> Ok, so it means that we will support 1-128 pixels 
>>> natively(MAX_ICON_SIZE) and others via MRI.
>> Why 128 pixels? Windows shell usually provides icons up to 256 
>> pixels, for example there are 256×256 icons for folders and generic 
>> file type.
> It is limitation of our implementation:
> https://bugs.openjdk.java.net/browse/JDK-8151385
> http://mail.openjdk.java.net/pipermail/awt-dev/2016-March/010777.html

I see. And it can be changed, if deemed necessary, can't it?

>> Since |IExtractIcon::Extract| gives you the requested size, 
>> performing scaling if required, then MRI will never be crea
> As far as I understand the bug above, it is possible that OS returns 
> some other size.

No, it is not.
In that bug icons are extracted from Image List which is created a part 
of Toolbar:

1036     HWND hWndToolbar = ::CreateWindowEx(0, TOOLBARCLASSNAME, NULL,

Then an icon is extracted from that image list.
Obviously, Toolbar can create and creates, as the bug report shows, its 
icon set of different size depending on the current DPI setting, or 
rather the DPI settings of the main display.

As for JOptionPane, the icons are loaded using ::LoadIcon which loads 
icon of the default size only. Depending on the current DPI setting, it 
may return icon of larger size.

Yet in this fix, the file icon is requested with explicit size. You will 
get the size you requested.


More information about the awt-dev mailing list