Rich client platforms versus JavaFX 2 versus Swing

G_H picture G_H · Nov 15, 2011 · Viewed 11.8k times · Source

Pretty soon now, we're gonna need to develop a GUI for creating configurations (more like scripts, to be honest) for our EAI solution at work. Think of a typical workflow editor. The visualization of the actual flows will most likely be a completely custom job, either in Swing, SWT or JavaFX 2. What I have trouble with choosing is whether to do everything else by ourselves or using a rich client platform.

In particular, I've noticed that JavaFX 2 is getting a lot of attention and seems to be really pushed by Oracle as the next big thing in the Java GUI landscape. The demonstrations look interesting and perhaps this newer API is more closely focused on productivity as opposed to the tons of boilerplate code that Swing tends to impose. Using a newer technology that gets a lot of support seems like a safe bet for future maintenance.

Using an RCP would have definite benefits for this project. Whether we go for Eclipse or NetBeans as the platform, having existing plugins/modules for viewing the underlying (XML) config, version control etc. would offer powerful functionality with minimal work. I also like the idea of having project types of our software next to Java projects in the same GUI. Even simple stuff like window management and customly arranging panels is much better handled by RCPs that what we could whip up.

So the question now is, what technology or combination thereof is viable? My options, as far as I can see, are thus:

  • Eclipse. I'm not too eager for using SWT, though, since I'm more familiar with Swing. NetBeans is also my primary IDE and I'm most familiar with it. It always felt more intuitive too.
  • NetBeans. This'd allow development of custom components in Swing. A lower learning curve for me.
  • NetBeans + JavaFX 2. This idea appeals to me... Use NetBeans for the RCP goodness and using JavaFX 2 for custom components. JavaFX 2 apparently integrates with Swing, but how well can this be done within NetBeans?
  • Swing or JavaFX 2. Do all the GUI work ourselves or use some existing framework(s) to get most of what an RCP offers. This seems like a lot of work but also offers superb control. I'm a bit loathe to try this in Swing. How well would JavaFX 2 suit itself to this?

Basically my only GUI experience is in Swing on small apps. This is the first time I'll be going for something that would warrant a RCP. But JavaFX 2 seems the way forward and I don't want to miss the boat on that one. If Swing might be on the way out, I'd prefer hopping onboard the newer technology.

If there are people who can share their experiences, have tried something like NetBeans + JavaFX 2 or are closer to the forefront of JavaFX and can recommend/discourage its use for this sort of thing I'd be most interested.

I realize it's a somewhat open question, but I can't really think of a more appropriate place. I'm not looking for a "what's the best RCP / is JavaFX better than Swing" debate. I'm looking for valid points for/against their use in this context.

Answer

Sébastien B. picture Sébastien B. · Jan 12, 2012

My opinion in few lines,

JavaFX2 can be integrated into Swing and SWT applications into a panel/container.

Swing doesn't provide a structured architecture to deal with multi components applications, Eclipse RCP does but it's heavier and sometimes too complex (WindowWorkbench etc..) and hard to customize.

If you have a good UI Designer in your team (Developer or Graphic Designer) you should begin to work on an application Full JavaFX2 with a simple but powerful framework (like JRebirth or a custom one you can build on your own way).

JavaFX will be the Java UI Standard for years to come, It could'nt be a bad choice, thus its architecure is pretty good and powerful Moreover javaFX2 could be used into a browser and/or deployed online with help of JNLP. Don't bother you to learn complex undocumented framework (like EclipseRCP), create Yours !! and be free to make the application your client need :D

I worked 3 years on Swing Appz, 2 years on Eclipse RCP, and 2 years on Flex/Silverlight/JavafX apps