JavaFX Ubuntu stage dock icon does not update

元气小坏坏 提交于 2020-01-04 05:49:10

问题


I am developing a JavaFX 8 application that runs cross-platform on Windows/OSX/Ubuntu via JWrapper. Right now I am using stage.getIcons().add(..) to set the stage icon to a 256x256 PNG bundled with the application. This works on Windows, however on Ubuntu, the dock icon remains the Oracle/Java default icon, as shown below. Is there some third party library, or some technique I can use to get my own icon and tooltip/title to display for the Ubuntu dock icon?


回答1:


Ubuntu is a bit different: You would need to set the icon within a .desktop file. As far as I recall from our Ant-based build script using the JDKs javapackager tool, it is able to do that for you, but this bundles the whole JRE with it as well and you would need access to a (virtual) machine for each target platform and architecture (there are no Delta packages like in Eclipse, unfortunatly).

So basically when you export your application, you should build a predefined .desktop file, which would specify both the exec command and the path to the icon (whre I don't know, if this needs to be absolute or relative to the .desktop file location).




回答2:


An issue was raised against openjdk https://bugs.openjdk.java.net/browse/JDK-8204936

Posting it here so that other will know the status



来源:https://stackoverflow.com/questions/36311638/javafx-ubuntu-stage-dock-icon-does-not-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!