Vaibhav's Blog Space

JavaFX - Samples + Usages.

Friday Jan 09, 2009

Ah, finally I got JNLP working on my blog, thanks to Sergey and Vikram. I am posting some of my samples with JNLP as we can use as repository for JavaFX samples :). These all are old samples but just with JNLP, so that we can run and see the effect. 

1. Spring Motion : We can create n no. of instance of Spring class. Detail is here. This example deals with Motion, Gradient and Physics Equations.

2. 3D Button Effect:  This example is about PressButton and 3D shadow effect. Detail is here. Basic deals with Shadow Effect, Gradient, and Animation.

3. Glowing Stars in Sky: This example I have created with JavaFX Production Suite. So, we made a home in Photoshop and imported that in JavaFX and then star animation is written in JavaFX. Detail is here. This sample deals with JavaFX Production Suite, Animation, Timelines and Shapes.

4. Colliding Balls: This we have blogged some 4-5 days back. This is again a physics motion with a transparent window. Detail is here. Sample deals with Motion, Equation, Timelines and Gradient. Initial positions and colors are random, so can be wired at sometime + style: StageStyle.TRANSPARENT has been used, so we will not see any frame and so close button will be missing, please press Ctrl + F4 to close the application :). I guess, the good practice is to write esc. key event and call FX.exit().

5. Image Depth support in JavaFX:  Image depth setting or in some language we call it Z-Ordering is supported in JavaFX too. Last to last blog is about that, so here is detail. This sample basically deals with toFront and toBack API of Node and Animation(nothing cool in terms of Animation :D). 

6. Pendulum Motion with Gravity Controller: This is just the last blog. Detail is here. This sample deals with Motion, Gradient and Complex Equations, Binding Feature. I have changed the code little from the prev. blog. Now, it is transparent, so it will give us a better look :)

Feel free to share your experience. I hope all JNLP should work, if not please let me know. Some more I will add soon, actually all these are older samples, just tried to make repoistory, so that easy to find :).

[20] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg
Comments:

Finally! Great work!

Posted by Angad Singh on January 13, 2009 at 01:56 PM IST #

All the jnlp work fine for me.
Really nice job.
I would rank it 20/20 if there was not this !!#@??!! Warning messages...

Posted by Thierry on January 14, 2009 at 03:06 PM IST #

thanks Angad, thanks Thierry.

ya, this should work else it was fake !

Posted by Vaibhav on January 14, 2009 at 04:18 PM IST #

Alas they don't work for me on OpenSolaris:

java.net.MalformedURLException: unknown protocol: socket
at java.net.URL.<init>(URL.java:574)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at java.net.URI.toURL(URI.java:1081)
at com.sun.deploy.net.proxy.DeployProxySelector.connectFailed(DeployProxySelector.java:204)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:384)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
at sun.net.www.http.HttpClient.New(HttpClient.java:306)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:844)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:792)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:703)
at com.sun.deploy.net.BasicHttpRequest.doRequest(BasicHttpRequest.java:185)
at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(BasicHttpRequest.java:63)
at com.sun.deploy.net.DownloadEngine.actionDownload(DownloadEngine.java:1098)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:1456)
at com.sun.deploy.net.DownloadEngine.getCacheEntry(DownloadEngine.java:1434)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java:1537)
at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(DownloadEngine.java:1465)
at com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:211)
at com.sun.deploy.net.DownloadEngine.getResource(DownloadEngine.java:195)
at com.sun.javaws.Launcher.updateFinalLaunchDesc(Launcher.java:297)
at com.sun.javaws.Launcher.prepareToLaunch(Launcher.java:167)
at com.sun.javaws.Launcher.launch(Launcher.java:111)
at com.sun.javaws.Main.launchApp(Main.java:315)
at com.sun.javaws.Main.continueInSecureThread(Main.java:219)
at com.sun.javaws.Main$1.run(Main.java:107)
at java.lang.Thread.run(Thread.java:619)

Posted by Chris Gerhard on February 03, 2009 at 02:23 PM IST #

Oh bad, any other JNLP works for you .. on any site. Or Solaris has problem with all JNLP's of JavaFX. Like try out this :

http://weblogs.java.net/blog/malenkov/archive/2008/12/how_to_lay_out.html

If so, we need to fig. out the problem.

Posted by Vaibhav Choudhary on February 03, 2009 at 02:28 PM IST #

https://swinghelper.dev.java.net/bin/blog/sam/20081218/Colors1.jnlp fails as well with the same exception.

Posted by Chris Gerhard on February 03, 2009 at 02:32 PM IST #

Alright, I will check out this problem. If somewhere bug has been raised or we will raise one :)

Posted by Vaibhav Choudhary on February 03, 2009 at 02:38 PM IST #

I tried all examples and all worked properly here. ;D

Posted by Silveira Neto on February 04, 2009 at 03:28 AM IST #

nice ! you are also running on Solaris ?

Actually this java.net.MalformedURLException error was there on my windows machine as well but I never digged down the reason.

Posted by Vaibhav Choudhary on February 04, 2009 at 12:28 PM IST #

Can you help me in making a media player with FX in an optimized way.Thank you.

Posted by rajashree on February 10, 2009 at 01:10 AM IST #

Sure, what are the features you are looking.
You can see some of the MP3 player or video players here on sample site :
http://javafx.com/samples/

Posted by Vaibhav on February 10, 2009 at 01:24 AM IST #

this is cool, everything works fine with me.

Posted by Vaibhav on February 27, 2009 at 02:05 AM IST #

Solaris and Linux isn't supported by JavaFx yet.

Posted by zammbi on April 06, 2009 at 04:30 PM IST #

Sorry, soon it will be :)

Posted by Vaibhav Choudhary on May 04, 2009 at 11:15 AM IST #

One of my favorite things about your blog is your use of specific examples to illustrate your point. I am feeling great to visit your blog. You sure have put lots of effort into this site.

Thanks,
Mark Smith
http://www.healthinsuranceinfo.org/

Posted by Mark Smith on July 30, 2009 at 01:05 PM IST #

Thank you Mark !

Nice to see health insurance techy reading JavaFX blogs :)

Posted by Vaibhav Choudhary on July 30, 2009 at 01:10 PM IST #

Hello everyone,

I really appreciate the effort into this article. I have very much valued the tools of blogging and twitter and slowly learning all the many hints and tips that I am very grateful for. All 6 points are nice and very informative for me.

I have 3 sites which may be helpful for visitors:

http://www.stream-max.com/
http://www.streamline-alliance.com/
http://www.streamline-markets.com/

Thanks,
Andrew Jacob

Posted by Andrew Jacob on July 30, 2009 at 01:21 PM IST #

This is great news. Best of luck for the future and keep up the good work.

Posted by China Wholesale on January 09, 2010 at 12:43 PM IST #

I have enjoyed reading, I will make sure and bookmark this page and be back to follow you.

Posted by klaussner furniture on January 23, 2010 at 02:37 AM IST #

Post a Comment:
  • HTML Syntax: NOT allowed