java fx 内置图标,将图标包含在一个独立的JavaFX应用程序(.exe)中

Followed the instructions here and here. I am using JDK 7u9 and NetBeans 7.2.1. What I did was create the whole path relative to my project's root folder (C:\Users\Administrator\Desktop\icotest\package\windows\icotest.ico). I tried both with a 48x48 and a 256x256 size. Here's a tree overview for my project called icotest:

│ build.xml

│ manifest.mf

├───build

│ │ built-jar.properties

│ │

│ ├───classes

│ │ └───icotest

│ │ Main$1.class

│ │ Main.class

│ │

│ ├───empty

│ └───generated-sources

│ └───ap-source-output

├───dist

│ │ icotest.html

│ │ icotest.jar

│ │ icotest.jnlp

│ │

│ └───web-files

│ dtjava.js

│ error.png

│ get_java.png

│ get_javafx.png

│ javafx-chrome.png

│ javafx-loading-100x100.gif

│ javafx-loading-25x25.gif

│ upgrade_java.png

│ upgrade_javafx.png

├───nbproject

│ │ build-impl.xml

│ │ genfiles.properties

│ │ jfx-impl.xml

│ │ project.properties

│ │ project.xml

│ │

│ ├───configs

│ │ Run_as_WebStart.properties

│ │ Run_in_Browser.properties

│ │

│ └───private

│ │ private.properties

│ │ private.xml

│ │

│ └───configs

│ Run_as_WebStart.properties

│ Run_in_Browser.properties

├───package

│ └───windows

│ icotest.ico

└───src

└───icotest

Main.java

This is what build.xml looks like:

No matter what I do - I still get this message during the dist build process (that activates ISS) with the debug flag set to true in the according build.xml file: "Using default package resource [application icon] (add package/windows/icotest.ico to the class path to customize)"

Any idea what I might be doing wrong? Thank you.

解决方案

Found the answer here. It appears that the guidelines posted on the Oracle's website are currently mismatching the actual deployment scenarios available. Namely, when dealing with NetBeans, ant is unaware of the current directory that is presumed to be your root project. As it has been suggested in the according forum thread - simply add the directory containing "package/windows/${projectname}.ico" to ant's classpath and it will pick up the relevant resource, even though the tutorial claims that this should happen automatically due to the existing (?) addition of '.' to the build script.

0ikeW.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值