Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8182043 Access to Windows Large Icons
  3. JDK-8267896

Release Note: New API for Accessing Large Icons

XMLWordPrintable

      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.

            kizune Alexander Zuev
            kizune Alexander Zuev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: