Geertjan's Blog

  • December 7, 2011

Deeper Integration of JavaFX in NetBeans RCP

Geertjan Wielenga
Product Manager

Nodes and Properties window integrated so that when the sales property changes, the javafx.scene.chart.BarChart is updated.

A screenshot of the JavaFX chart in the context of a Swing application. The up/down animations in the chart as the sales property is changed (in the JTable or in the Properties window or by renaming the Node) are pretty cool.

To create the above, I started out with the Paint Application (a NetBeans RCP example distributed with NetBeans IDE), then migrated some of the JavaFX code discussed in the previous blog entry, added a node hirerachy, and that was all.

By the way, the above is how I see JavaFX fitting into the real world of existing Java desktop applications. No one is going to throw Swing out the window completely, that wouldn't make any sense. However, where it makes sense to do so, which is in fewer places than what might be assumed, a corporate enterprise (as opposed to a game-oriented) Java desktop application could gain from some of the aspects of the JavaFX story.

Join the discussion

Comments ( 6 )
  • zhouzx_gogo Wednesday, December 7, 2011

    Hello, can provide source code, I want to learn how to achieve it? Thank you.

  • zhouzx_gogo Wednesday, December 7, 2011

    See the above example, I want to know is how to achieve, and can provide the source code for learning about, I believe is the best Netbeans RCP rich client platform.

    I'm using it to develop budget management platform, I need to integrate charts and MS Excelt, word or openoffice. Is there any good solution? Thank you

  • Bernd Ruehlicke Thursday, December 8, 2011

    As so often Geertjan, you are spot on what is of interest to a humble corporate enterprise desktop application developers hopes and dreams. I was exactly looking for this kind of heterogeneous integration. It is a start in the correct direction. I.e. careful inject FX components where possible and where its give added value, have it living side by side with swing in peace. Instead of total swing replacement - which as you said makes no sense in the real world. I am looking forward and get inspired to try out to add/replace a few components. Thanks !

  • Patrick Boulay Friday, December 9, 2011

    Nice , but where is the source code ?

  • Per-Erik Svensson Wednesday, December 21, 2011

    Would you like to share why replacing swing with javafx makes no sense? I agree if you're solely talking about existing apps, but newly started projects? Are there any specific reasons to start a new project in swing rather than javafx - besides platform maturity?

    As I see it, it makes no sense to create new swing apps. In ongoing projects though, I would certainly agree. (Unless you're doing a complete restructuring of your UI.)

    Just curious if I have missed some fundamental flaw in the JavaFX way of doing things that makes Swing a platform for the future too! :)

  • Geertjan Wednesday, December 21, 2011

    There's going to be a mixing of Swing with JavaFX for a long time to come. For example, there are hundreds, probably thousands, of existing Swing components out there in the world. So, if you are only going to use JavaFX, you're going to be reinventing the wheel a lot of the time. The NetBeans Platform, for example, is a set of Swing libraries. Any large application makes complete sense to be created on top of the NetBeans Platform (free plugin system, free docking framework, etc)... but that means you're not using JavaFX.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.