Java通过JNLP与用户的桌面操作系统很好地集成。 我的软件不仅显示为桌面图标,而且在控制面板中列为已安装程序(Windows 7)。我也能够获得JNLP文件来自动配置文件关联。现在,如果用户双击我的程序(一个pxml文件)保存的文件,程序将启动。通过网络发布,JNLP可以使这种出色的桌面整合顺利进行。 还有一个问题:如何让我的程序加载用户双击的数据文件? pxml文件被赋予与我的程序相同的图标,并且JNLP创建了文件关联,因此Windows知道在用户尝试打开pxml文件时启动我的软件。但是,我的程序在启动时如何知道打开该文件?Java JNLP桌面快捷方式和图标
下面是引用JNLP文件的组成部分,从Proctinator.com
<jnlp spec="6.0+" codebase="http://proctinator.com/dist" >
<information>
<title>The Proctinator</title>
<vendor>Smart Software Solutions, INC.</vendor>
<homepage href="http://proctinator.com"/>
<description kind="short">The Proctinator exam scheduling software</description>
<icon kind="splash" href="splashScreen.jpg" />
<icon kind="shortcut" href="bigP.jpg" />
<offline-allowed/>
<association extensions="pxml" mime-type="application/pxml"/>
<shortcut online="false">
<desktop/>
</shortcut>
</information>
<resources> <j2se version="1.6+"/> ... </resources>
<application-desc main-class="thornworks.proctor.GUI"/>
从来没有尝试过,但这不会得到只是作为您的main()方法的参数传递? – mikera 2012-03-02 01:32:41
JNLP无效(并且格式错误),请尝试使用[JaNeLA](http://pscode.org/janela/)进行检查。 – 2012-03-02 06:30:17
Andrew - 上面的XML不是整个文件。你确定JaNeLA是最新的并且认识到用1,6引入的新语法吗? – Thorn 2012-03-02 11:12:40