File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JavaFX and the fly likes JavaFX vs Flex Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JavaFX
Bookmark "JavaFX vs Flex" Watch "JavaFX vs Flex" New topic
Author

JavaFX vs Flex

Jeff Storey
Ranch Hand

Joined: Apr 07, 2007
Posts: 230
Stephen and Dean,

Could you provide your insights as to JavaFX vs Adobe's Flex? It seems like both aim to create slick UIs more quickly than Swing. What advantages does JavaFX offer? I think Flex is primarily aimed toward web apps but I think it can also be used for desktop apps. Should they be seen as competitors or are there ways for them to work together?

thanks,
Jeff


Jeff Storey
Software Developer
[url]http://jeffastorey.blogspot.com[/url]
Dean Iverson
author
Greenhorn

Joined: Aug 30, 2009
Posts: 20
I think you can certainly view JavaFX and Flex as competitors (which probably explains the presence of James Ward in this forum ).

I haven't used Flex as much as JavaFX, but here are my general impressions:

Flex is more mature having been on the market longer. In my opinion, Flex has a better deployment story particularly for applications running in the browser. I give the edge in tooling to Flex Builder over the NetBeans JavaFX plugin. And if you need to play Flash video and know that it will just work, then Flex is your best bet at the moment.

On the other hand, JavaFX takes full advantage of the power of the JVM (multi-threading in a Flex app is not well supported, for example). I also think that JavaFX solves some problems in a more elegant way than Flex. The ability to bind to an arbitrary expression in JavaFX is very powerful. Further, JavaFX's declarative syntax is, in my opinion, far superior to having to use XML to declare your UI as in Flex.

To summarize, Flex is a nice mature toolkit but it is evolutionary whereas JavaFX is more revolutionary. Hopefully the cliche police aren't lurking here.

Dean


Dean Iverson
book - blog - twitter
Jeff Storey
Ranch Hand

Joined: Apr 07, 2007
Posts: 230
Thanks for your insights. Would you say that JavaFX is more geared toward web applications or do you also think it is well suited for slick desktop apps (maybe I'm in the minority here of people creating desktop apps with Java, or desktop apps in general)? It seems like Flex is aimed towards RIAs although I know it can be used for desktop apps.


Further, JavaFX's declarative syntax is, in my opinion, far superior to having to use XML to declare your UI as in Flex.

I agree with the declarative syntax - but does JavaFX offer much in that aspect over Groovy's Swing Builder?

I've always done desktop apps in Swing - trying to find out if it's getting to be that time to move on...

thanks,
Jeff
Dean Iverson
author
Greenhorn

Joined: Aug 30, 2009
Posts: 20
I think JavaFX, like Flex, is ideally suited to creating RIAs that run in the browser and on the desktop. I'm primarily a desktop developer myself and have used JavaFX in several small and medium sized apps for the desktop (primarily web service clients and the like).

I'm a fan of Groovy, but to me JavaFX's syntax is cleaner than SwingBuilder. In addition, the binding support in JavaFX is more powerful and for a project of any significant size I prefer a statically typed language for the extra compile-time checks and the better tool support.
Jeff Storey
Ranch Hand

Joined: Apr 07, 2007
Posts: 230
I think JavaFX, like Flex, is ideally suited to creating RIAs that run in the browser and on the desktop.
While I haven't used WPF/Silverlight, I've heard that it's not truly cross browser/desktop (meaning it may require some different code in places to run on the desktop or browser). In your experiences with JavaFX (or Flex), can the same code truly run in both the browser and as a desktop app?

thanks,
Jeff

PS - I appreciate your time here at the forum this week.
Dean Iverson
author
Greenhorn

Joined: Aug 30, 2009
Posts: 20
You can absolutely run the same code on the browser and in the desktop. There are some special cases you may want to handle for a browser environment, but that is easily done by detecting the environment at runtime and using the Stage and related classes such as AppletStageExtension.

Extending a desktop/browser app to mobile is a little trickier. You have to be careful to use only the common profile, which can be slightly limiting sometimes. And you run into other odds and ends that aren't supported on mobile such as string formatting directives.
Jeff Storey
Ranch Hand

Joined: Apr 07, 2007
Posts: 230
Great, thanks so much. Sounds like I've got some new topics to learn about (and maybe I'll win a book too!).

Jeff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaFX vs Flex