Compensates to migrate from Swing to JavaFX?

7

Currently most of my applications are made with Swing. I've done 2 small web projects with JSF + Primefaces + Hibernate. My question is this:

Is it worthwhile to go out of Swing and study JavaFX, or is it better to study the Web part more and continue with Swing for desktop applications?

    
asked by anonymous 13.05.2015 / 16:40

1 answer

9

JavaFX seemed like a good idea at first, it brought several new features like:

  • More sophisticated GUI;
  • UI developed in FXML (which is based on XML);
  • Easier to use MVC;
  • Support CSS, and so on.
While the Swing is older and more robust, and although many feel that JavaFX came to replace Swing, the trend shows that the two will continue to exist in parallel, because despite the news I do not usually see much being developed in JavaFX, and its support remains much smaller than that of Swing.

The learning curve of both platforms are not the simplest, there are several tricks you will learn as you develop and this can result in a significant delay for your projects as long as you do not master the tools.

I'd say you should migrate from Swing to JavaFX only if you really need more modern UI with animation and stuff like that, or if you want to venture out academically. Take care if you want to do professional projects on an unfamiliar platform, you are likely to encounter difficulties that you will not be able to predict before you start the project and may be late than expected.

If you are not intimate with either tool, I would say to start with Swing because there is a lot more code in Swing in production than JavaFX, so chances are one day you will come up against a work in progress from someone who was done with Swing is much larger than in JavaFX.

In fact, Java for Desktop is something that has not worked very well, very few companies use this solution and therefore if you are investing to enter the labor market do not focus on any of these technologies, go deeper into the Web part. requires you to know more than simply Java, you will constantly have contact with other technologies and you must master a much larger range of them, you do not need to be an expert (if it is better), but you will need to know JavaScript, HTML and various frameworks Web-based Java. But believe me, you will have a lot more open ports than if you want to insist on Java Desktop.

TL; DR

Opt for JavaFX only if you really need the modern UI for Desktop, or if you're giving a curious one in an undated project to finish. If your need is to develop something in Desktop with Java and that does not need fancy UI, go / continue Swing.

If you're looking to get deeper into Java to get into the job market but without a fixed target, forget both and go Java EE.

    
13.05.2015 / 17:01