Java Champion / JavaOne Rockstar Adam Bien (adam-bien.com) is a self-employed consultant, lecturer, software architect, developer, and author in the enterprise Java sector. He is also the author of several books and articles on Java and Java EE technology, as well as distributed Java programming. adam has posted 59 posts at DZone. View Full User Profile

Why JavaFX is Intriguing for Java Developers

02.23.2009
| 12599 views |
  • submit to reddit
  1. Java FX Script is consistent: everything is an expression. Knowing that helps a lot.

  2. Additional access modifiers (script-only, public-read, public-init) allow leaner approaches for building, not only visual, components.

  3. The "skeleton" of a Java FX application is the scene graph. It is a tree structure starting with stage, scene, and has nodes as leaves. It  represents a platform independent model of any visual application. You could actually map this "meta-tree" to any technology you want. I believe this exactly happens in the desktop and mobile profiles (requires further investigation :-)).

  4. There is no additional ceremony required to call Java objects: it is straight forward. Existing Java code can be easily reused.

  5. RESTful (JSON/XML) communication is supported out-of-the-box.

  6. The "bind" operator enables building of lean Model View Presenter (Passive View / Supervising Controller) applications with clean seperation of concerns. Modification of variables and even functions are tracked directly, without implementing PropertyChangeListeners etc.

  7. Triggers killed getters and setters. You can expose attributes directly and intercept the calls when needed.

  8. Java FX Script is perfectly suitable for building casual and not only "flashy" applications. The majority of Swing components are already exposed to Java FX script.

  9. Domain specific extensions like the duration datatype or frame-based animation framework make the development of animations easier.

  10. Java FX Script integrates very well with applets and webstart. It is a natural extension of Java-based RIAs. The idea of dragging an applet out of the browser and installing it as an application is simple, but really good :-).

From http://www.adam-bien.com/roller/abien/entry/java_fx_script_and_why

Published at DZone with permission of its author, adam bien.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Bob Smith replied on Mon, 2009/02/23 - 12:30pm

I read an insightful post on java.net speculating that Sun views JavaFx Script as a superset of the Java language and its eventual replacement:

http://java.net/cs/user/view/cs_msg/673284

If this is to be Java's eventual replacement as a language, then it should presumably be decoupled from the graphical aspects of JavaFX.  This would allow Sun to offer JavaFX Script separate from the the JavaFX framework, allowing the former to be open sourced and distributed freely to Linux and Solaris users.

Granted, this is probably not easy, otherwise Sun would have probably done it already.

 

Peter Koželj replied on Tue, 2009/02/24 - 6:26am

1) JavaFx Script is NOT consistent

While the JavaFx is object oriented java like (or javascript like) language, the syntax for working with sequences is totally wird:

insert "Monday" into days;

Not only that the syntax is looks alien, but this is actually much worse. Sequences are immutable in JavaFx, so a new sequence is created that holds all members from the original sequence and the newly "inserted" element. After that the "days" variable is assigned a reference to the new sequence WITHOUT the assignment operator!

Things like that put me off. What would be wrong with something like: days = days.add("Monday")
or even: days += "Monday"?


4) But the other way around is a pure nightmare and using JavaFX code inside Swing application is
    one big messy hack.

6) Only if you stay inside JavaFx. One way calling into Java might be easy, but binding to it, it is not.

8) Only a small number of basic Swing components are exposed. For others like tables, trees, ... (the complex ones) you have to do it yourself.

10) Dragging applet out of browser has nothing to do with JavaFx, it works with Swing too.
 
I do not dislike JavaFX but some parts of it are just weird and feel unfinished. Swing integration I miss the most.

Currently there is a huge lack of JavaFx and Swing controls, making the JavaFx useless for anything but fancy multimedia players. Binding is great for simple things, for serious applications one needs models, renderers... The big question for me is, how well will JavaFx support big complex applications that need to display huge tables, trees...

There were some blogs and interviews where different sun people were talking about JavaFX as a Swing2. Currently there is nothing in JavaFX that makes Swing THE powerful toolkit.

 

Regards,

Peter

darryl west replied on Tue, 2009/03/10 - 3:16pm

JavaFX isn't ready for prime time, and, it may never be.   After spending a solid week with it, while reading every chapter of the early release "Pro JavaFx" from Apress, I'm completely disappointed.  I was able to pick up Ruby in a few days and Groovy in less time.  It almost seems that JavaFX goes out of its way to make things confusing and difficult.

Try creating a simple login dialog.  You might want a password component, but there isn't one in JavaFx.  You can try to hack one together using JPasswordComponent, but it's a mess.  You could try SwingComponent.wrap() but now you are mixing languages, and defeating the purpose of JPasswordComponent's use of char[] rather than string for security.  What a joke.

You might just try capturing the key events in a JavaFx Swing text--but they don't work yet.  WTF?

Simple thinks like when to I have to use a semi-colon and when not?  And try explaining to your end users why they have to click "Trust" twice before an application finally loads.  Pathetic.

At this point I think it's much more productive to stick with straight java, or better groovy, especially using SwingBuilder.   JavaFx is a waste of time at this point.

jiji530 (not verified) replied on Mon, 2009/06/29 - 9:38pm

thanks for your post.perhaps you will like abercrombie ed hardy mortgage rates tiffanys ed hardy Is not it?

super pan replied on Sat, 2009/08/01 - 12:30am

Java Fx is expected to be the next hot spot for developers. New Balance

Carla Brian replied on Mon, 2012/07/30 - 6:33pm

With JavaFX, developers can preserve existing investments by reusing Java libraries in their applications. They can even access native system capabilities, or seamlessly connect to server-based middleware applications. - Mercy Ministries

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.