Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are your feelings on JavaFX?

Tags:

javafx

ria

I currently do a lot of work in ActionScript 3.0, I also love to program in Java. Is JavaFX perfect for me? What is the general feeling on JavaFX, will it become a power house, or go down the same path as Java Applets? Could the designers I work with become comfortable with JavaFX to the same extent they are comfortable with ActionScript and JavaScript?

like image 223
ForYourOwnGood Avatar asked Feb 10 '09 19:02

ForYourOwnGood


People also ask

What is JavaFX good for?

JavaFX is a set of graphics and media packages that enables developers to design, create, test, debug, and deploy rich client applications that operate consistently across diverse platforms.

What is the main purpose of the latest JavaFX release?

The latest JavaFX version contains important enhancements to improve performance, stability and security of the JavaFX applications that run on your machine.

What does JavaFX stand for?

JavaFX stands for special effects in the Java language. Internet applications are made richer with different plugins with the help of JavaFX. This is an alternative to the ways for building a website or any other applications. We can say JavaFX is a declarative and statically typed scripting language.

Why is JavaFX preferred over swing?

In short, Swing and JavaFX are both GUI toolkits for Java programs. Swing is the old standard toolkit that features a bigger library of GUI elements and mature IDE support. JavaFX is the newer standard with a smaller library, more consistent updates, and consistent MVC support.


3 Answers

Just wanted to add my $.02... I've been working in JavaFX for the last 4 days on my first little side-project using it. As some background, I've been programming professionally for about 9 years, starting with C, and have been doing Java and C#/.NET for the last 6 yrs.

IMO, JavaFX its way more frustrating that it should be. Here are some gripes:

  1. The syntax is just odd at times. It could easily be more like Java, since its JavaFX. But the syntax isn't an easy transition from Java.

  2. The order of items in a .fx file actually matters, which means you run into stupid circular reference errors, and "oh you can't use this variable yet because it hasn't been initialized" problems that the compiler should handle with ease, but doesn't.

  3. Random things just don't work. Actions/events on Swing controls don't always work, for example SwingSliderBar's onKeyPressed/released don't seem to be called.

  4. Error handling is just bad. If an exception occurs that isn't handled, there is no real way to tell other than the Java console, and UI elements start to react funny. For example, make a SwingText box and bind its value to a variable. Now trying to edit the value in the text box will throw an exception because you cant edit the bound variable. However in the UI, the text box just starts having funny things happen. some characters only 1/2 paint, sometimes backspace does nothing, sometimes it deletes a character, sometimes you can press 2 keys ont eh keyboard like "1" and "2" and the text box will end up having "21" entered in it instead of "12", etc...

Although my absolute #1 problem with JavaFX development right now is Netbeans. It is pathetically bad at JFX. Can't debug, errors display wrong in the IDE (I've had it flag comments as errors!), the intellisence only works like 40% of the time, event he code templates preprogrammed in the IDE for drag & dropping controls aren't correct. I forget which one, but one of them drops a "&" at the end of the inserted code that is never valid and always has to be manually deleted... its just plain awful, and is unacceptable for a company like Sun.

Another gripe is general documentation. Its just lacking. Somehow the JavaFX API doesn't even come up as the #1 search result on google when searching for methods/classes. Tons of "examples" out on the web don't work any more as every version has major refactoring changes, and classes removed or renamed.

Overall, I give JFX a 4 out of 10. I want to like it, but JFX 1.1 just doesn't cut it... its definitely not what I would consider "production ready".

like image 92
CodingWithSpike Avatar answered Nov 01 '22 08:11

CodingWithSpike


A resounding "meh".

When I looked at it a year ago, they had a one-way SVG to JavaFx conversion tool. Great, so you can author your visual content once, mark it up with a lot of behaviour, and then the next time you want to make it look good, then what?

If you take a look at this tutorial you can see what I mean. We're drawing stuff by dragging shapes from a palette into source code. OMGWTF. I am not showing that to my graphics department.

I hope I'm wrong about JavaFx, but I don't think they get it. Please, won't somebody at Sun give us a presentation layer that doesn't have its tentacles inextricably intertwined with code?

like image 27
joeforker Avatar answered Nov 01 '22 10:11

joeforker


I left my last job to move from Java to .NET development.

There were a number of reasons for making the move, but the single biggest reason was that I was sick and tired of trying to build 1st class UI software with Java & Swing. It has been six years and I'm so glad I moved on. I see no reason to believe that Sun finally understands UI development with JavaFX.

I am convinced that Microsoft is finally in the process of giving us a platform to build rich interactive applications in the browser. I say that after having built commercially available software which was delivered as a Netscape Plugin 13 years ago, followed by ActiveX controls and Java Applets, and seeing all of these platforms fail to become ubiquitous in the enterprise for one reason or another.

I realize that Silverlight 2 is still lacking in depth and maturity, but Microsoft has shown me enough commitment at this point that I believe it will be the dominant RIA platform in a few short years - at least for projects which require a "real" programming language. I am sure Flash et al. is not going away anytime soon, but Flash is not appropriate for the kinds of software my company builds.

The icing on the cake for me is the fact that I will still be able to use Visual Studio, C# and a large percentage of my current code base (the core engine which is entirely separate from the UI). Of course, if you are coming from ActionScript, this would not help you.

One more important point is the fact that Silverlight and WPF share so much in common. Our plan is to share a large amount of implementation between Silverlight and WPF versions of our software. It is only a matter of time before WPF is the standard for Windows applications – I don’t know whether that is a couple of years or ten years, but it will clearly happen over time. Being able to target the most popular browsers / OS’s with Silverlight and Windows from the same code base is a tremendous advantage IMO.

If you know Java then moving to C# is a piece of cake. And unless you are using one of the nice (not free) Java IDEs, then even the free versions of Visual Studio will be an improvement over what you are used to. The hurdle will be learning the new way of doing things with XAML – but it’s some pretty cool stuff so you might actually enjoy it.

like image 20
Joe Erickson Avatar answered Nov 01 '22 08:11

Joe Erickson