tags:

views:

228

answers:

1

I've got the following JNLP:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0.10//EN" "http://java.sun.com/dtd/JNLP-6.0.10.dtd"&gt;
<jnlp spec="6.0.10" version="1.63" codebase="http://foo.example.com/msi" href="Foo.jnlp">
    <information>
        <title>Foo</title>
        <vendor> Foo Systems, Inc.</vendor>
        <homepage href="http://Foo.com"/&gt;
        <description>Foo Viewer/Editor Application</description>
        <icon href="splash.gif" width="425" height="102" kind="splash"/>
        <icon href="Foo.gif" width="64" height="64"/>
        <offline-allowed/>
        <shortcut>
            <desktop/>
            <menu submenu="Foo Systems, Inc."/>
        </shortcut>
        <association mime-type="application-x/wlog" extensions="wlog"/>
        <association mime-type="application-x/mplot" extensions="mplot"/>
    </information>
    <security>
        <all-permissions/>
    </security>
    <resources>
        <j2se version="1.6+" initial-heap-size="32m" max-heap-size="255m"/>
        <jar href="jars_deployment/TimingFramework-1.0.jar"/>
        <jar href="jars_deployment/iText-2.1.5.jar"/>
        <jar href="jars_deployment/jai_codec.jar"/>
        <jar href="Foo.jar"/>
        <jar href="jars_deployment/TimingFramework-1.0.jar"/>
        <jar href="jars_deployment/iText-2.1.5.jar"/>
        <jar href="jars_deployment/jai_codec.jar"/>
        <jar href="jars_deployment/jsch-20090402.jar"/>
        <property name="apple.laf.useScreenMenuBar" value="true"/>
        <property name="apple.awt.graphics.UseQuartz" value="false"/>
        <property name="com.apple.mrj.application.apple.menu.about.name" value="Foo"/>
        <property name="java.util.logging.config.file" value="/Users/Shared/logging.properties"/>
    </resources>
    <application-desc main-class="com.prosc.msi.editor.ui.test.Sandbox"/>
</jnlp>

Most everything is working. When I double-click a .wlog file, it opens up my application. However, it doesn't open the correct file. I read somewhere that JNLP was supposed to pass parameters to the main method indicating which file caused the app to be launched, but this is not happening (on OS X 10.6). I get an empty array to my application's main method.

Probably unrelated, my splash screen doesn't work :(

Any pointers on getting this working?

+1  A: 

In a bundled application on Mac OS X, you can implement com.apple.eawt.ApplicationListener, as shown in the Mac OS X Reference Library example, OSXAdapter:

The sample also supports document handing from the Finder by implementing the handleOpenFile() method and registering for supported file types in its Info.plist file.

trashgod
Thanks trash, how about on windows? Do I rely on main() method arguments?
Sam Barnum
Sorry, I never tried on Windows. FWIW, the splash screen seems to work on the Sun tutorial demos.
trashgod
Thanks! haven't actually tested this out yet, but will let you know if anything interesting comes up.
Sam Barnum