JNLP-enabled JavaFX samples

38 views
Skip to first unread message

Amit k. Saha

unread,
Jan 13, 2009, 3:11:48 AM1/13/09
to bojug
Hi Folks,

http://blogs.sun.com/vaibhav/entry/javafx_some_samples lists some JNLP
powered JavaFX samples from Vaibhav's blog.

Best,
Amit

--
Amit Kumar Saha
http://amitksaha.blogspot.com
http://amitsaha.in.googlepages.com/
Skype: amitkumarsaha

Vaibhav Choudhary

unread,
Jan 14, 2009, 8:36:32 AM1/14/09
to Bangalore Open Java Users Group- BOJUG
:).

This is how you can do it in netbeans :

Project -> Properties - > Run -> Web Start Execution. It will generate
some files :

1. Project.jar
2. Project.jnlp
3. Project_Browser.jnlp.
4. Carousel.html

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>

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. So, the new jnlp file will
look like:

<?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>

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 :).

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>

thats it !

Pleas,let me know if there is any issue.

cheers,
Vaibhav


On Jan 13, 1:11 pm, "Amit k. Saha" <amitsaha...@gmail.com> wrote:
> Hi Folks,
>
> http://blogs.sun.com/vaibhav/entry/javafx_some_sampleslists some JNLP
Reply all
Reply to author
Forward
0 new messages