JavaFX - Samples + Usages.

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


Finally! Great work!

Posted by Angad Singh on January 13, 2009 at 05:56 AM 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 07:06 AM IST #

thanks Angad, thanks Thierry.

ya, this should work else it was fake !

Posted by Vaibhav on January 14, 2009 at 08:18 AM IST #

Alas they don't work for me on OpenSolaris: unknown protocol: socket
at com.sun.javaws.Launcher.updateFinalLaunchDesc(
at com.sun.javaws.Launcher.prepareToLaunch(
at com.sun.javaws.Launcher.launch(
at com.sun.javaws.Main.launchApp(
at com.sun.javaws.Main.continueInSecureThread(
at com.sun.javaws.Main$

Posted by Chris Gerhard on February 03, 2009 at 06:23 AM 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 :

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

Posted by Vaibhav Choudhary on February 03, 2009 at 06:28 AM IST # fails as well with the same exception.

Posted by Chris Gerhard on February 03, 2009 at 06:32 AM 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 06:38 AM IST #

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

Posted by Silveira Neto on February 03, 2009 at 07:28 PM IST #

nice ! you are also running on Solaris ?

Actually this 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 04:28 AM IST #

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

Posted by rajashree on February 09, 2009 at 05:10 PM IST #

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

Posted by Vaibhav on February 09, 2009 at 05:24 PM IST #

this is cool, everything works fine with me.

Posted by Vaibhav on February 26, 2009 at 06:05 PM IST #

Solaris and Linux isn't supported by JavaFx yet.

Posted by zammbi on April 06, 2009 at 09:30 AM IST #

Sorry, soon it will be :)

Posted by Vaibhav Choudhary on May 04, 2009 at 04: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.

Mark Smith

Posted by Mark Smith on July 30, 2009 at 06:05 AM IST #

Thank you Mark !

Nice to see health insurance techy reading JavaFX blogs :)

Posted by Vaibhav Choudhary on July 30, 2009 at 06:10 AM 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:

Andrew Jacob

Posted by Andrew Jacob on July 30, 2009 at 06:21 AM 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 04:43 AM 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 22, 2010 at 06:37 PM IST #

Hello Vaibhav

I am a physics teacher in London and I am trying to learn JFX to make animations for my lessons. I am came across your "Insertion trigger in JavaFX" and "Motion of Ball Under Gravity - JavaFX" posts earlier in your blog. In both of these you kindly presented code, which I tried to use. However, I am unable to get the code to work in Netbeans. For example, lots of the import statements (import javafx.scene.geometry.\*; or import javafx.application.Frame;) do not exist.

I could write such an application in Processing or Flash quite easily (without the use of classes) but I am specifically now trying to learn JFX and how to use classes. Therefore your examples, if they work, will be perfect for me to try and learn. I noticed that the blog posts are very old, so maybe this is why I cannot get them to work.

Do you have these applications in newer code? Or maybe you could update your code for everybody to try and learn from?

As somebody who is struggling with JFX your help would me much appreciated!

Thank you

Matt Klein

Posted by Matt Klein on June 14, 2010 at 04:18 PM IST #

Java FX is great!

Posted by Daniel Sourcing on September 28, 2010 at 12:34 AM IST #

i am trying to build a video/audio recorder cum player and i had designed the frame in JavaFx and to link it with java as core engine

Posted by sudeep on September 29, 2010 at 01:36 AM IST #

Post a Comment:
  • HTML Syntax: NOT allowed

Vaibhav Hi, I am Vaibhav Choudhary working in Oracle with JDK team. This blog is all about simple concept of Java, JVM and JavaFX.


« November 2015