Pays to migrate from Swing to Javafx?

Asked

Viewed 4,016 times

7

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

It pays to quit Swing and study Javafx, or it’s better to study the Web more and continue with Swing for desktop applications?

2 answers

10


Javafx seemed a good idea at first, she brought several news like:

  • GUI more sophisticated;
  • UI developed in FXML (which is based on XML);
  • Easier to use MVC;
  • CSS support, and etc.

While Swing is older and more robust, and although many think that Javafx came to replace Swing the trend shows that the two will continue to exist in parallel, because despite the novelties 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 while you do not master the tools.

I would say that you should migrate from Swing to Javafx only if you really need more modern UI, with animation and things like that, or if you want to venture academically. Take care if you want to do professional projects on an unknown platform, you will probably run into difficulties that will not be possible to predict before starting the project and may have delays beyond your expected.

If you don’t have intimacy with either of the two tools I would say start with Swing, because there’s a lot more code in Swing in production than Javafx, then the chances of one day you bump into a work in progress of someone who was done with Swing is much higher than in Javafx.

Actually Java for Desktop is something that did not work very well, very few companies use this solution and consequently if you are investing to enter the labor market do not focus on any of these technologies, get deeper into the Web part. The Web part however requires you to know much more than just Java, you will constantly have contact with other technologies and should 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 several Java-based Web frameworks. But believe me, you’ll have a lot more open doors than you want to insist on Java Desktop.

TL;DR

Opt for Javafx only if you really have the need for modern Desktop UI, or if you’re being curious about an undated project to finish. If you need to develop something Desktop with Java that doesn’t need fancy UI, go/continue to Swing.

If you’re looking to delve into Java looking to enter the job market but without a fixed target, forget both and go from Java EE.

  • I understand, I have come to the conclusion that I will only study Javafx and continue using Swing for applications, since it makes no difference the modern UI. And I will delve into Java EE too. Thank you

  • 1

    @Diegoaugusto increased the response a little and added the part that talks about Java EE. I had stopped for lunch, so it took a while :) Maybe I’ll add some information later, but then I’ll let you know.

  • 1

    Why not study Java for android?

  • @user24857 he did not ask that :) Moreover I would say that I don’t quite know the subject to give my opinion, but I know that today there are many cross-Platform options that can do better than Java. I honestly cannot speak with certainty on this subject, otherwise I would even add in my answer without problems.

  • Yes, Google thinks of using Dart for android.

  • It seems to me a little based on opinion are not @Math?

  • @Jorgeb. I think it’s a valid question. If you prefer to hear other opinions it takes pro meta or pro chat

Show 2 more comments

0

Hello, well let’s see how is the Swing and Javafx taking their similarities and differences.

Swing

Swing was a successor to the SWT that made the GUI better and was also created new Componentes, Also developed is Look and Feel where you can improve your appearance for the windows GUI for example. It was also a place for other components developed, and its way of creating a GUI is easier with designers like Eclipse Windowbuilder where we can organize the Form (Jframe) and the code and add new methods.

Javafx

Javafx was also a major change (as was cited by the above reply)

  • GUI more sophisticated;
  • UI developed in FXML (which is based on XML);
  • Easier to use MVC;
  • CSS support, and etc.

While Swing is older and more robust, and although many think that Javafx came to replace Swing the trend shows that the two will continue to exist in parallel, because despite the novelties I do not usually see much being developed in Javafx, and its support remains much smaller than that of Swing.

Javafx is code based java and in xml, where part of the graphics passes to . fxml the java would only pass in loading fxml and executing the actions and events written in . fxml, Ides does not have an integrated designer to develop Javafx but has Gluon’s Scenebuilder program to edit and organize a . fxml.

Upshot

It would be better to give a learning in Swing because Swing is a kind of tutorial on how to develop a Form and then for Javafx

Browser other questions tagged

You are not signed in. Login or sign up in order to post.