0

Is it possible to read the icons from a computer's desktop folder and display them in an application?

EDIT: What I mean by "icon" is retrieving the image used to display. Reason being is that some program don't use direct shortcut images by default or a user ops to not create a shortcut when installing a program. As I've already checked my folder, I've noticed icons such as these based on their properties (Type of file):

  • Safari - *.lnk
  • Photoshop - *.png
  • Visual Studio - *.exe

All of these display their icons in some sort of way (png is obviously the easiest), but where this non-image extensions resides isn't exactly clear.

1 Answers1

1

Unfortunately, there is no cross-platform API for retrieving application-specific or user-substituted icons. For specific platforms, look at Windows and Mac OS X.

Alternatively, consider FileSystemView, which is "the gateway to the file system" used by JFileChooser. It abstracts many of the platform-specific icons used by the file system. Several examples that use the facility are illustrated here.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045