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

Sergey Bylokhov serb at openjdk.java.net
Wed May 26 21:42:16 UTC 2021


On Fri, 21 May 2021 19:37:19 GMT, Alexander Zuev <kizune at openjdk.org> wrote:

>> 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.
>
>> But how you got them via this method? I am not sure what parameters should be passed to it.
> `
> String userdir = System.getenv("userprofile");
> Icon icon = FileSystemView.getFileSystemView().getSystemIcon(new File(userdir + "\\3D Objects"), 64);
> `
> 
> For some of the libraries getting file reference is quite easy, for some - not so much. But still doable.

Great!

-------------

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


More information about the awt-dev mailing list