<AWT Dev> RFR: 8182043: Access to Windows Large Icons [v7]

Alexey Ivanov aivanov at openjdk.java.net
Fri May 21 19:15:04 UTC 2021

On Fri, 21 May 2021 18:16:36 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>>> It is accessible from the "JFileChooser" drop-down menu. On my system, the Libraries at that drop down menu contain "GIT", "Documents", "Music". https://docs.microsoft.com/en-us/windows/client-management/windows-libraries
>>> There are also "known folders" such as "Network" or "My computer" which do not have a real path but can be navigated in the JFileChooser and has an icon.
>> Ok, got it. Well, since they can be translated into the file system paths - even if these paths do not belong to physical filesystem - they are supported by the new API. Not for all of them i am able to receive the high resolution icons - like "Recent Items" for some reason only provides 32x32 and 16x16 no matter what size i am asking for. Others such as Documents, My Computer or 3D Objects do provide all resolutions available. For example here's the screenshot of all the available icons for 3D Objects 
>> ![image](https://user-images.githubusercontent.com/69642324/119092517-62a9f980-b9c3-11eb-9d51-b7745cab564c.png)
> But how you got them via this method? I am not sure what parameters should be passed to it.

Didn't you answer your question already? If `FileSystemView.getRoots()` returns Desktop in Windows shell namespace. Otherwise, I don't know a way to get a reference to a *virtual* folder in Windows shell namespace which doesn't reference a file system object.

Alex's example uses "3D Objects" folder which is one of the known folders and has its own icon instead of the standard folder icon.

It's possible that I don't understand the question clearly.

Alex's fix affects WindowsPlacesBar on the left of JFileChooser in Windows LaF, the icons there look crispier in High DPI environment.


PR: https://git.openjdk.java.net/jdk/pull/2875

More information about the awt-dev mailing list