<AWT Dev> <Awt Dev>  Review Request for 8022057: JFileChooser blocks EDT in Win32ShellFolder2.getIcon
semyon.sadetsky at oracle.com
Thu May 28 06:44:23 UTC 2015
Please review fix for JDK9:
The full story can be found in the jira's comments and NetBeans tracker
It seems the bug proposes to change the design of the AWT shell support
on Windows platform. But instead I tried to eliminate the user
experience issue it can be a good step to improve the situation.
The user experience issue is the JFileChooser spontaneous delays caused
by getIcon(): I could not reproduce this under Win7 and jdk8/9. But I
found in MSDN that ExtractIcon Win32 API call can take significant
amount of time in some cases. Mostly when the file is an executable or a
link and its icon is not cached yet.
MS propose a way how to avoid that: use asynchronous flag GIL_ASYNC with
GetIconLocation call which then may return E_PENDING which means
consequent ExtractIcon call can take time. There are several ways to
handle E_PENDING return I propose just to use the default icon for the
file which can be obtained with GIL_DEFAULTICON flag and should be much
faster. Since I cannot reproduce the issue I don't know how effective it
Also in the fix I added possibility to get Windows-Libraries icons,
which were not available before in the JFileChooser.
More information about the awt-dev