JDK-8267896 : Release Note: New API for Accessing Large Icons
  • Type: Sub-task
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 17
  • Priority: P3
  • Status: Closed
  • Resolution: Delivered
  • Submitted: 2021-05-27
  • Updated: 2022-03-23
  • Resolved: 2021-07-16
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17
17Resolved
Description
A new method, `javax.swing.filechooser.FileSystemView.getSystemIcon(File, int, int)`, is available in JDK 17 that enables access to higher quality icons when possible. It is fully implemented for the Windows platform; however, results on other platforms might vary and will be enhanced later. For example, by using the following code:
```
  FileSystemView fsv = FileSystemView.getFileSystemView();
  Icon icon = fsv.getSystemIcon(new File("application.exe"), 64, 64);
  JLabel label = new JLabel(icon);
```

The user can obtain a higher quality icon for the "application.exe" file. This icon is suitable for creating a label that can be better scaled in a HighDPI environment.