JavaFX Ubuntu Stage Dock图标未更新 [英] JavaFX Ubuntu stage dock icon does not update

查看:115
本文介绍了JavaFX Ubuntu Stage Dock图标未更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发JavaFX 8应用程序,该应用程序通过JWrapper在Windows/OSX/Ubuntu上跨平台运行.现在,我正在使用stage.getIcons().add(..)将阶段图标设置为与应用程序捆绑在一起的256x256 PNG.这在Windows上有效,但是在Ubuntu上,停靠图标仍然是Oracle/Java默认图标,如下所示.是否有一些第三方库,或可以用来获取我自己的图标和工具提示/标题的技术,以显示Ubuntu Dock图标?

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?

推荐答案

Ubuntu有点不同:您需要在.desktop文件中设置图标.据我回想起,使用JDK的javapackager工具在基于Ant的构建脚本中,它能够为您做到这一点,但是这也将整个JRE与它捆绑在一起,并且您需要为每个虚拟机访问(虚拟)计算机目标平台和体系结构(不幸的是,没有像Eclipse中那样的Delta软件包).

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).

因此,基本上,在导出应用程序时,应该构建一个预定义的.desktop文件,该文件将同时指定exec命令和图标的路径(我不知道,是否需要绝对路径或相对路径) .desktop文件位置.

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).

这篇关于JavaFX Ubuntu Stage Dock图标未更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆