Good bye, Swing. Welcome, JavaFX 8.

I am rather reluctant to new technologies, as often these are immature and imperfect. Hence, I go long time with established standards. But sometimes, I switch rather quickly, when things make a leap forward. This time it happened with JavaFX.

For decades Swing was my first choice, as it is part of the Java SE standard, is mature, rather completely, maintained, well-understood and supported by third parties. So why change it? But recently, our team had to make decision for the future. And this was the end of Swing.

Our problem was: We have to write a desktop application (possibly for the last time ever), and it shall have a modern and fresh GUI. Sure, we could do it with Swing and a lot of brainwork inspired by Chet Haase, Romain Guy and Karsten Lentzsch. But looking at the decades of hard work and sleepless nights we had with Swing since we started to use it in professional software around the millenium, we thought it might be beneficial to do a market analysis first. And it was!

While we knew JavaFX for years, starting with v1 and that ugly language one was forced to learn, we always abstained from using it when it come to final decisions. It was simply not ripe for prime time. But what we just set up practically overnight with JavaFX 8 was impressing. The clean MVC support, the separation of programming, view layout and design, property bindings, FXML-defined controls, CSS Pseudo-Class support, and a lot more, not to forget about the fresh looking design of v8, was simply astonishing. Not to mention, our whole team had a jump start in just five days from zero to all features plus first contributions to the OpenJFX source base, and another two weeks to our first custom layout managers and complex custom controls. This is fun-providing pace!

Looking back at the tough times with Swing’s outdated API and rustic style, we are really happy to get past it. We know, it might not have a long time to live due to the migration from desktops to mobiles the younger generation dictates us despite all negative effects upon productivity and quality of work, for the time until it will be our first choice definitively. It is really bug fun. It is productive. It is mature. And it is actively supported. Go get it!

If you liked Swing, you will love JavaFX! Make the move now!

Advertisements

About Markus Karg

Java Guru with +30 years of experience in professional software development. I travelled the whole world of IT, starting from Sinclair's great ZX Spectrum 48K, Commodore's 4040, over S/370, PCs since legendary XT, CP/M, VM/ESA, DOS, Windows (remember 3.1?), OS/2 WARP, Linux to Android and iOS... and still coding is my passion, and Java is my favourite drug!
This entry was posted in Java and tagged . Bookmark the permalink.

14 Responses to Good bye, Swing. Welcome, JavaFX 8.

  1. Serious software needs Accessibility support. JavaFX has no Accessibility support built in. So it is basically a “no-go” as a serious UI toolkit.

    I see many good things in JavaFX. But for many (too many) scenarios, it is not ready to take over from Swing. I think there is no clear positioning if JavaFX – it is not really “Swing 2.0”, it is not really “mobile ready”, and it does not use the browser as a platform. Seeing it running (or better: crawling) on low-powered ARM devices, I am convinced that it is also not targetted at the embedded space. Difficult to judge where it will end up in the future.

    Like

  2. JavaFX is slow on older laptops with integrated video, Swing starts/works much faster.
    And ports on Android/IOS still in alpha stage, which keeps from switching large army of devs…

    Like

  3. Mike says:

    Thank You for this article. Great information and good news. I look forward to sharing our Excitement about Objectwheel with everybody soon.

    Like

  4. Shai Almog says:

    I loved Swing which is the exact reason I’m staying the hell away from JavaFX and can’t understand Swing developers jumping in head first.
    Sun (this predated Oracle) stopped maintaining Swing when it focused on FX years ago and left us hanging. I have very little doubt they are already doing the same with FX, they never kill a project but with slow and heavy update cycles (you have to update the full JDK with an all new set of bugs) this just isn’t practical. We have some FX in our Swing applications since there is absolutely no other choice, but we are seriously considering writing the entire UI in native code and having Java communicate with that for a future version.

    Notice that in the last two JavaOne’s the demos highlighted on stage were all of embedded and IoT. Desktop development is dead at Oracle and mobile development was abandoned too so unless you are using Java on the server side I don’t think Oracle has anything here.

    Just to make sure I asked a couple of very well known prominent FX consultants when I was at JavaOne whether anyone “serious” was picking up FX and they explained that the only people picking it up were developers of existing Swing projects who needed some new functionality integrated and couldn’t get the functionality in Swing.

    I’d say its just my 2 cents but having worked for Sun and Oracle (since 99) I think I can read rather well between the lines…

    Like

    • Markus Karg says:

      The actual problem is that Oracle knows for sure that there is no really active external community participating to OpenJDK in any measurable form (sad but true, as a long time open source contributor I can say that many many project leads have no interest in any co-workers, and most programmers have no interest in spending time for open source, still, as they work for money, not for fun). Hence, Java goes where Oracle wants. Unless the Java community massively takes over control, we all have to live with it. And “it” means: Swing is dead, JavaFX is not yet. Desktop is killed, Mobile is hyped. I do not say that I like that truth, but I cannot change it all alone. So I have to use what the mighty Oracle gives me. And looking at Swing 8 and JavaFX 8, it clearly is JavaFX 8.

      Like

    • Mike says:

      Javafx is very much alive and the ability to Run on 6+ platforms with one code base will cause developers to migrate to Javafx in bus loads. We are 3+ years into a Very large Very powerful Javafx application called Objectwheel. With 100K people download this app within 12 months and start using it for Social media, browsing, searching, and RAD app creation you will change your mind. Already we have Linux, Mac, Windows and Android support and we are in Beta.

      Like

      • Markus Karg says:

        I don’t care about betas and things in queues. Let’s just wait three years and judge then. 😉

        Like

      • Shai Almog says:

        Mike, by this logic Codename One whose apps are already downloaded by over 50MM people on all mobile platforms and even on desktop platforms has taken over the world already 😉

        Even when Objectwheel proves to be successful (as I hope it will be) this will change nothing for FX. Limewire was a big success in the day and it didn’t make much of a difference to Swing. Azureus / Vuze did nothing for the traction of SWT.

        FX is dead since developers have just “moved on” and Oracle won’t invest the effort required to pull them back. The whole field of dreams “if you build it they will come” doesn’t really work anymore since people built so many different tools.

        Liked by 1 person

  5. Hi Markus,

    Thanks for this entry, it is very clear, rationale and to the point.
    About the last paragraph: I don’t think the migration from desktop to mobile makes the lifespan of JavaFX any shorter, as the broader JavaFX community is working hard on JavaFX Mobile (e.g. http://javafxports.org and http://robovm.org).

    • Johan

    Like

    • Markus Karg says:

      We will see how long JavaFX will get actively maintained and developed further, the more HTML 5 + ECMA script gains popularity. Flash is dead. Silverlight is dead. Why should JavaFX survive? Look at the publicity Oracle does for project Avatar, and compare it with the investments into Swing, JavaFX, JSF + JavaEE (already noticed that there apparently are no EJB + JSF teams paid by Oracle anymore?). Where is the announced free Android + iOS packaging of JavaFX? Where is the Actions and Dialogs framework needed so badly? Let’s see if it ever gets published. For me, JavaFX is only a transitional technology, as some fools decided that HTML 5 + ECMA script is cool while an Applet is not, but it is superior to Swing from my view point as an application developer. This is not what I want, but it is what happens all everywhere at the moment.

      Like

  6. Pingback: JavaFX links of the week, October 20 // JavaFX News, Demos and Insight // FX Experience

Comments are closed.