Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java desktop application frameworks vs. JavaFX

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.

like image 953
Sonicsmooth Avatar asked Jan 26 '16 17:01

Sonicsmooth


People also ask

Is JavaFX good for desktop applications?

JavaFX is a great UI toolkit to write Cross-platform desktop applications. With https://gluonhq.com/products/mobile/ support, it is even possible to write mobile applications.

Is there anything better than JavaFX?

GWT, Vaadin, Qt, JSF, and Electron are the most popular alternatives and competitors to JavaFX.

What is the best Java framework for desktop applications?

Spring Boot, Swing, JavaFX, Vaadin, and Play are some of the best Java Frameworks for Desktop Applications.

What is the difference between Java and JavaFX?

JavaFX is an open-source web platform that enables developers to create modern user interfaces for desktop, mobile, and browser applications. Java Swing is a GUI toolkit for Java, originally designed by Sun Microsystems. It is one of the most popular toolkits in the world.


2 Answers

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

  • http://efxclipse.org/ - in fact it leverages the same core stuff than the Eclipse 4 IDE / RCP 4 but replaces the SWT layer with JavaFX
  • http://www.jrebirth.org/
  • http://www.drombler.org/drombler-fx/
  • http://jacpfx.org/

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

like image 152
tomsontom Avatar answered Oct 21 '22 13:10

tomsontom


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,

like image 21
Sébastien B. Avatar answered Oct 21 '22 13:10

Sébastien B.