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

查看:28
本文介绍了使用 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>

任何想法将不胜感激.

推荐答案

我会按顺序尝试以下操作:

I would try the following, in order:

  1. 创建一个 32x32 大小的图标并将其添加为附加 <icon kind="shortcut"....规范 说大小用于桌面图标.
  2. 使用您的 64x64 图标作为默认"图标.例如,您的新 元素将是:

  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 元素中的 codebase 属性访问的

  • 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天全站免登陆