When using swing I am able to use FileSystemView.getFileSystemView().getSystemIcon(file)
to get a awt Icon
object from an exe file. I now need to use JavaFX, but am lost as to how to get an image I can display in an ImageView
. Is there a way to convert the image or perhaps a similar method as getSystemIcon
, but for javafx?
Asked
Active
Viewed 164 times
0

user3900751
- 115
- 7
-
https://stackoverflow.com/questions/30970005/bufferedimage-to-javafx-image – Joop Eggen Oct 19 '20 at 10:35
-
that requires a BufferImage, but we have an Icon here – user3900751 Oct 19 '20 at 10:38
-
Yes one would need an ugly conversion using `paintIcon` AFAIK. A newer link with moved package: https://openjfx.io/javadoc/11/javafx.swing/javafx/embed/swing/SwingFXUtils.html It might be more maintainable, that when the .exe stems from something like InnoSetup to generate the icon file too. – Joop Eggen Oct 19 '20 at 11:06
-
it could help https://stackoverflow.com/questions/38145329/fetch-icons-of-my-system – Hasanuzzaman Rana Oct 19 '20 at 11:22