3

Possible Duplicate:
Can I delete downloaded JNLP file (Java web start/JWS) from Java application?
Launch webstart without downloading…?

I created a JWS program that starts by clicking an HTML link that takes you to the JNLP file. However, what Chrome browser does, it presents a file download dialog asking if you want to "keep" or "discard" the file. A lot of users oversee that dialog and never click on "keep".

But in some websites I see that that dialog is not present and the JWS is automatically launched. How can I do the same in my case?

Example of direct launch:

http://docs.oracle.com/javase/tutorial/uiswing/layout/box.html

Community
  • 1
  • 1
Ska
  • 6,658
  • 14
  • 53
  • 74
  • *"Example of direct launch:"* Ughh. Did it not occur to you to link to your JNLP that breaks, ***as well as*** one that works? It is probably down to mime-type, and I might have checked that in the time it took to type this comment. – Andrew Thompson Nov 09 '12 at 05:37
  • Sorry, but the other is on closed environment. Mime-type is set and shouldn't be an issue. – Ska Nov 09 '12 at 17:50

1 Answers1

6

That page uses the java deployment toolkit http://docs.oracle.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html#deplToolkit.

It is a javascript that does some other things for you as well, as ensuring an installed jre on the client machine and so on.

you can find it here: http://java.com/js/deployJava.js or a human readable version here: http://www.java.com/js/deployJava.txt

basicaly you use it like this:

<script src="http://www.java.com/js/deployJava.js"></script>
<script>
    var url = "http://java.sun.com/javase/technologies/desktop/javawebstart apps/notepad.jnlp";
    deployJava.createWebStartLaunchButton(url, '1.6.0');
</script>
Aksel Willgert
  • 11,367
  • 5
  • 53
  • 74