使用JWS JNLP为JavaFX应用程序创建桌面图标 [英] Creating a desktop icon using JWS JNLP for a JavaFX app

查看:177
本文介绍了使用JWS JNLP为JavaFX应用程序创建桌面图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的应用程序显示自定义destop图标,但由于某些原因,无论我做什么,都会显示相同的默认java图标。我已经尝试了所有我能想到的东西,并将我的jnlp文件与其图标似乎正常工作的其他人进行了比较。根据我读过的所有内容,以下内容应该可以正常工作。但当然,它不会:

I am trying to get a custom destop icon to be displayed for my app but for some reason no matter what I do the same default java icon shows up. I have tried everything I can think of and gone and compared my jnlp file with others whose icons seem to work ok. According to everything I have read the following should work fine. But of course, it doesn't:

<information>
    <title>MikesApp</title>
    <vendor>Mike</vendor>
    <homepage href="http://www.mikesapp.com/"/>
    <description>Mikes App.</description>
    <icon kind="shortcut" href="res/icon64x64.png" width="64" height="64"/>
    <offline-allowed/>
    <shortcut>
        <desktop/>
    </shortcut>
</information>

我们非常感谢任何想法。

Any ideas would be greatly appreciated.

推荐答案

我会按顺序尝试以下方法:

I would try the following, in order:


  1. 创建一个大小为32x32的图标将其添加为附加< icon kind =快捷方式... 规范说明了这个尺寸用于桌面图标。

  2. 使用64x64图标作为默认。例如,您的新< icon> 元素将为:

  1. Create an icon of 32x32 in size and add it as an additional <icon kind="shortcut".... The spec says that size is used for desktop icons.
  2. Use your 64x64 icon as the "default". For example, your new <icon> elements would be:

<icon href="res/icon64x64.png" width="64" height="64"/>
<icon kind="shortcut" href="res/icon32x32.png" width="32" height="32"/>
<icon kind="shortcut" href="res/icon64x64.png" width="64" height="64"/>


  • 请记住,您的图片是相对于您的代码库访问的 jnlp xml元素中的code>属性

  • Remember that your images are accessed relative to your codebase attribute in your jnlp xml element

    如果这些都不起作用,你就是欢迎将您的JNLP与我的其中一个有效进行比较。

    If none of those work, you are welcome to compare your JNLP to one of mine that works.

    我意识到这个JNLP的东西是一种痛苦。希望其中一个适合你。

    I realize that this JNLP stuff is kind of a pain. Hope one of these work for you.

    这篇关于使用JWS JNLP为JavaFX应用程序创建桌面图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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