Vaibhav's Blog Space

Swing to FX converter

Wednesday Jun 04, 2008

Don't know what made me to think on this. But JavaFX seems to be the next hit of Sun Family. JavaFX is dealing with Rich Internet Application and Content based UI. Being a scripting language ,coding is considered to be easy but as a developer I personally think in Java Frame of Mind coding. This probably let me think on this. Is there any chances that we can converter all the existing Swing or UI application into JavaFX. Probably most of the Java UI application base is written in Swing and Applet, can we make a tool where we can convert existing application into FX application + those programmers who are not feeling very comfortable with JavaFX(like me :D) can also make stuff in JavaFX style.

I remember some 3-4 years back, there was a similar situation with AJAX. Being using JavaScript, developers are finding it difficult to write application in AJAX and then Google came with its toolkit called GWT which gives the developer flexibility to write code in Java and rest will be taken care by Google Toolkit. And now, I can say AJAX is one of the major hits. Making such converters always help in capturing market and developer find them self more attached to a programming language. Why only Swing/applet to JavaFX, it can be JS/HTML/CSS to JavaFX.

Talking of implementation, it's quite tough to write API based conversion means converting say Swing API to JavaFX API. One of my colleagues gave me a quite better idea to grab the output and then do the conversion. Means, run a Swing written application, pass the PID into our converter and then generate the JavaFX code. It is tough but not too much. At least in Java, we have supports of things like accessibility API's which can help us in doing this.

Please let us know your point of view.

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

I think its a great idea, and will be very useful, might just as well be the next big thing that is waiting to happen to JavaFX, GFI!! :)

Posted by Aditya Kumar Sharma on June 04, 2008 at 11:41 PM IST #

This is quite an amazing idea you've posted here. JavaFX is already too hot to handle these days, and if this Swing2FX converter comes out anytime soon, things would explode! Keep up the great idea's coming :D

Posted by Angad Singh on June 04, 2008 at 11:42 PM IST #

grt idea, i tried converting swings to jsf, i took the swings xml form generated by netbeans and applied xslt over it and converted it, can u please tell me how u have done using pid, and if possible can u give ur source code so that i can learn more

Posted by Karthik Bala on June 05, 2008 at 03:53 PM IST #

Its going to be a big hit for sure. If you haven't already, you might also want to look at 'Using JavaFX objects in Java'
(http://java.sun.com/developer/technicalArticles/scripting/javafx/javafx_and_java/index.html)

This can be a good starting point : Analyze Java Program that create Swing UI and replace Swing UI objects with JavaFX equivalent objects keeping the rest of the Java code intact.

Posted by vadiraj on June 06, 2008 at 01:20 PM IST #

Thanks for your comment and motivation.

For Karthik, there are some accessibility API's which can be helpful. Actually it takes the control before control goes to JVM. So, it can easily found out the components you have on your UI, relations and all.

If you remember, its can work as you have seen Spy++ in VC.

Posted by Vaibhav on June 07, 2008 at 12:06 AM IST #

This has been blogged about as "Bright idea: A Swing-to-JavaFX converter" at JavaWorld.com !
http://www.javaworld.com/community/?q=node/779

I'd say, (your style), "Go For It!"

Posted by Angad Singh on July 07, 2008 at 11:25 PM IST #

I think that's good idea,, i hope it will be our next project to improve JavaFX performance

Posted by parman on April 05, 2009 at 01:28 PM IST #

This is my first post on blogs.sun.com. I hope to use this space do discuss current topics in the areas on web application security and data privacy.
http://www.watchrolexshop.com
http://www.gamegoldme.com
http://www.cheap-lotrogold.com
http://www.globalsale.me/Aion-gold-083.aspx
http://www.cheap-gamegold.org
http://www.gamegoldvip.org

Posted by lotro gold on June 25, 2009 at 12:08 PM IST #

I really like this idea.Yesterday I had to covert some of Java code JavaFX. So I thought why some hasn't tried writing a tool till now. And searched over the net.. and got your blog and its been posted as Bright Idea. Good Vaibhav..

Posted by Raghu Nair on July 14, 2009 at 08:29 AM IST #

solar street lights solar street lights solar street lights

Posted by solar street lights on October 30, 2009 at 08:38 AM IST #

I have received several similar emails like this one.

Posted by link of london on November 07, 2009 at 06:44 AM IST #

I really believe that these social networks will have a huge impact on what we can accomplish as groups, it'll help us be very organized and communicate.

Posted by links london on November 11, 2009 at 10:21 AM IST #

I really believe that these social networks will have a huge impact on what we can accomplish as groups, it'll help us be very organized and communicate.

Posted by ed hardy purses on November 17, 2009 at 06:53 AM IST #

Post a Comment:
  • HTML Syntax: NOT allowed