views:

5597

answers:

5

I know Flex pretty good but also started to use Java FX. I am a little bit confused. Java FX seems to focus more on low level drawing operations and animations. Less on creating standard UIs like Flex.

So is JavaFX more like Flash than Flex?

On the other side JavaFX also supports Swing components as well as data binding, which makes it appear more like Flex.

+14  A: 

I think JavaFX is more like Flex, because JavaFX is more about building applications than animations (which is, I gather, one of the sensitive distinctions between Flex and Flash).

I think of JavaFX and Flex as the future heirs to Rich Internet Application programming. They're both intended to stretch the realm of what's possible with RIA.

One of the biggest benefits of JavaFX that I see is that you can use your existing Java business logic by simply importing it.

Some of the language features, such as binding and duration as a data type, are paradigm-shifting, because they make certain functionality possible and readily available:

  • Binding: Connecting two values together, so you can automatically update one value when the other updates. Example: "name: bind textfield.getValue". Much easier than setting up Observer patterns to watch for changes to variables.
  • Duration can be used as a data type: "var frameDelay = 5ms". Having Duration as an integral part of the language seems like a no-brainer when dealing with animations.
David
Can you be more specific as to why binding and time as a data type are paradigm-shifting?
defmeta
I don't consider Flex as the 'old' technology. It's different. Flash focuses more on drawing and animating primitive objects, while Flex does the same on a higher abstraction level that is more suited for forms and classical UIs. But JavaFX has lots of low level object manipulation functionality.
Yaba
Oops! I meant >>I don't consider FLASH as the 'old' technology.<<
Yaba
Sorry, I wrote this too early in the morning after a late night, and it wasn't as well-written as it could have been. I've edited my post.
David
@Yaba: I would agree that Flash isn't "old". That didn't come out right!
David
@David: Thank you... sounds much more reasonable now.
Yaba
I really like the **idea** of JavaFX and would **love** to switch to it from Flex, but they still have a long way to go in a lot of areas before I'd consider it mature enough. Right now Flex and Silverlight (maybe) are the only real mature RIA options out there. In the future it'll be great when that changes. Removing the (admittedly tiny) ActionScript language barrier for Java devs to jump to real RIA development and get away from this JavaScript hacking stuff people are stuck on will be huge.
Crusader
+1  A: 

I'd say it's more like Flash - or at least it's about bringing Flash-like abilities to Java. Don't forget that Flex is built on top of Flash. JavaFX script from what I've seen is quite similar to ActionScript, and not at all like MXML. Sun seem to be stressing the importance of things like video and the ability to work with vector graphics from industry standard design programs.

I think beauty of Flash is the ability to create your own, nice-looking UI components, whereas Flex is about laying out standard components using tags. So again, it's more like Flash.

Iain
A: 

I'm a Flex developer with background in Flash - no Java experience. So, I'd normally skip this thread, but I happened to run across this post, just now:

http://www.insideria.com/2008/11/is-client-side-java-losing-gro.html

It contains a short discussion on Java and Flex, but what is most appropriate to your question, Yaba, is the link to a series of articles a group called Sharendipitous is posting about their conversion from Java to Flex - why they made the decision, how they did it, etc.

Ross Henderson
+2  A: 

Just saw this posting by Chet Haase, who previously worked on Java FX at Sun, but now works for Adobe on Flex.

Yaba
"The availability of the JavaFX runtime is basically that of the Java platform ... (I believe it will require the latest updated 10 release)" I just wanted to say he is wrong about this point, I am on Mac Os 10.4 with Java 5, and Java Fx works for me.
James McMahon
+2  A: 

I would like to add few points,

  1. Flex is far more stable then JavaFX, JavaFX is fairly new.

  2. JavaFX syntax is really bad, its unnecessarily complex, where else flex is pure xml, one can read and understand easily, I didnt understand what made java guys think that instead of using xml (like silverlight and flex), making new language syntax will shock the world? New syntax means new learning curve.

  3. Flex runs on flash, 95% installations world wide, only 1.2MB of Flash download compared to JavaFX + Java runtime of minimum 30 mb, this is too big consideration for publisher.

Akash Kava
"... flex is pure xml" - I have doubts about this. Flex is actually sdk which uses XML documents (MXML) and ActionScript as programming language.
zdmytriv
Hm... I disagree here. MXML will be translated to AS, which can cause problems. And then you have to decide whether to implement components in MXML or AS (the later is more powerful). JFX is more like JSON, but has at least a consistent syntax.
Yaba
MXML is basically shorthand for AS code, which is a good thing when you consider how much you'd have to type to do the same thing procedurally (look at your typical Java Swing app to see the difference - massive, long, repetitive lines of properties getting set - yuck).
Crusader