Published January 14th, 2009
JavaFX Samples in JNLP Style
In my last blog, I have added jnlp files of JavaFX samples. These are the simple steps how to do it with the help of netbeans.
Step 1: Compile the Project after this change(here my project name is Carousel) :
Project -> Properties - > Run -> Web Start Execution.
Step 2: It will generate some files :
- Project.jar
- Project.jnlp
- Project_Browser.jnlp.
- Project.html
Step 3: Open jnlp file in editpad, and you need to do some changes:
Here it will look originally:
<?xml version="1.0" encoding="UTF-8"?> <jnlp spec="1.0+" codebase="http://localhost:8082/servlet/ org.netbeans.modules.javafx.project.JnlpDownloadServlet/D%3A/ NetBeansProjects/Carousel/dist/” href=”Carousel.jnlp”> <information> <title>Carousel</title> <vendor>Vaibhav Choudhary</vendor> <homepage href=”http://localhost:8082/servlet/ org.netbeans.modules.javafx.project.JnlpDownloadServlet/D%3A/ NetBeansProjects/Carousel/dist/”/> <description>Carousel</description> <offline-allowed/> <shortcut> <desktop/> </shortcut> </information> <security> <all-permissions/> </security> <resources> <j2se version=”1.5+”/> <property name=”jnlp.packEnabled” value=”true”/> <property name=”jnlp.versionEnabled” value=”true”/> <extension name=”JavaFX Runtime” href=”http://dl.javafx.com/ javafx-rt.jnlp”/> <jar href=”Carousel.jar” main=”true”/> </resources> <application-desc main-class=”carousel.Main”/> </jnlp>
Step 4: You need to change: CodeBase with what is required(means where you
uploaded the file, you need to upload jar file and jnlp(modified
file). In my case it is : http://blogs.sun.com/vaibhav/resources/.
this is where we upload file in Sun blog
Step 5: So, after change :
<?xml version="1.0" encoding="UTF-8"?> <jnlp spec="1.0+" codebase="http://blogs.sun.com/vaibhav/resources/” href=”Carousel.jnlp”> <information> <title>Carousel</title> <vendor>Vaibhav Choudhary</vendor> <homepage href=”http://blogs.sun.com/vaibhav/“/> <description>Carousel</description> <offline-allowed/> <shortcut> <desktop/> </shortcut> </information> <security> <all-permissions/> </security> <resources> <j2se version=”1.5+”/> <property name=”jnlp.packEnabled” value=”true”/> <property name=”jnlp.versionEnabled” value=”true”/> <extension name=”JavaFX Runtime” href=”http://dl.javafx.com/ javafx-rt.jnlp”/> <jar href=”Carousel.jar” main=”true”/> </resources> <application-desc main-class=”carousel.Main”/> </jnlp>
Step 6: Look at the href: http://dl.javafx.com/javafx-rt.jnlp, this will take
care of the responsible jar or jnlp files which is required by JavaFX
Runtime. Just a word of caution, look at your lib folder as well,
which will be there in your dist directory along with jnlp and jar
files. If it has something, then upload that as well in lib/files(most
of the time it will be empty). But if you have used Java Production
Suite, there will be files like javafx-fxd.jar files :).
Step 7: In blog now just add a line(in html) :
<p style="width: 500px;"><a href="blogs.sun.com/vaibhav/resource/ Carousel.jnlp"><img border="0" src="http://java.sun.com/products/jfc/ tsc/sightings/images/webstart.small.jpg” /></a></p>
That’s it !












Java,JavaScript,Threading,
Optimization and more with Vaibhav 


