Java/JavaFX: Set Swing Icon for JavaFX label
问题 I'm trying to read a thumbnail (icon; 32x32px) from a file (.ico/.exe) and set it to a JavaFX label. My first try: public Icon getLargeIcon(String exeFile) { if (exeFile != null) { File file = new File(exeFile); try { ShellFolder sf = ShellFolder.getShellFolder(file); return new ImageIcon(sf.getIcon(true), sf.getFolderType()); } catch (FileNotFoundException e) { e.printStackTrace(); } } return null; } After that I'm doing this: Icon largeIcon = getLargeIcon(file.getAbsolutePath()); ImageIcon