Java desktop application frameworks vs. JavaFX

24,293

Solution 1

There are plenty of them looks like your research has not been very thorough

As I'm the author of e(fx)clipse I'm biased but I know first hand that it is used on (big) commercial projects

Solution 2

In my opinion, Swing, JavaFX and also SWT are graphical toolkit, providing a set of basic widgets. There are not "Application" frameworks because their main goal is to display an User Interface. But you can use them to build an application without any other library by using basic features.

A good sample application can be found here: https://github.com/angelicalleite/museuid

It looks really nice with data picked from a mysql database, but if you read carefully the source code you can notice that all SQL queries are performed within the UI thread which will slow down the UI responsiveness.

This is one of the reason you should use an Application Framework. Their goals vary and are numerous but they all are dedicated to ease your application development by keeping complex things (like multithreading, messaging) out of your application code.

Your choice shall be done according to your personal convictions about architecture and dependencies you want to use (or don't).

I'm the author of JRebirth (disclaimer), but I sometimes have a look on other frameworks, so you can make your choice by asking yourself some basic questions:

Do you want/need OSGI support ?

=> Yes efxclipse, DromblerFX, DEMUX

=> No JRebirth,JacpFX, DataFX, griffonFX, afterburner.fx

Do you want a minimalist framework?

=> Yes afterburner.fx

Do you want/need event messaging?

Do you want to share code?

Do you want modularization?

Do you require Java 7 support ?

How do you want to manage your application threads.

I certainly forget a lot of questions.

In fact you SHOULD use one of these Application Framework (building your own will be time-consuming), it will defintely speed up your developments and secure them, the remaining questions are :

  • What AF will fit your needs ?
  • What AF will be convenient to use for you and your team ?

Choosing an AF using patterns you don't like could be painful, in any case you can contribute to any available AF because they are all open sourced.

Hope it helps,

Solution 3

The simple answer to this is: JavaFX is much younger than Swing - at least as a standard JDK library. As a matter of fact, it only became a "real" standard part with Java 8. If you check the history, you see the following facts:

  • Before JavaFX 2 (released 2011), developers needed to learn a scripting language.
  • Also before JavaFX 2, the implementation aimed at being platform independent and therefore made no use of system-specific resources which can make a big difference in graphics and animation.

Read through it, and you'll find some more interesting details which can be summed up in that probably most developers have only been "seriously" noticing JavaFX within the last 5 years or so. Swing goes back much further (especially as being baked into the standard Java Runtime Environment), so naturally there are far more libraries aimed at Swing than at FX.

Share:
24,293
Sonicsmooth
Author by

Sonicsmooth

Updated on October 08, 2020

Comments

  • Sonicsmooth
    Sonicsmooth over 3 years

    There are a lot of Java "application frameworks" such as those listed in http://pivot.apache.org/demos/ which pretty much all use Swing as the GUI toolkit, or in the case of Eclipse, SWT.

    However I have not seen any obvious frameworks for JavaFX. Why is this?

    If looking at the "Hollywood Principle", where the framework calls you, I would think JavaFX already does this, but then I'm confused because it would seem Swing and JavaFX do mostly the same role, which is as the GUI layer. But they both do event loops and callbacks/events/observer patterns, etc.

    Does merely implementing an event loop and calling your event handler not qualify as an "application framework"?

    If not, are there any frameworks based on JavaFX directly (rather than embedding JavaFX in a Swing control)? What would such a framework provide that JavaFX standalone does not?

    Sorry for the "obviousness" of this question, but it's not obvious to me.

    thanks.