Migrating commercial applications from Swing to JFX

Scott Palmer swpalmer at gmail.com
Thu Jan 24 04:42:54 PST 2013

At the moment the CSS isn't terribly useful for layout, it's mostly about the look of individual elements rather than where they go.  JavaFX doesn't use the HTML "box" model for all layout (or any layout actually), it has different kinds of containers that do layout differently much like Swing layout managers.  Given that, there are some things that are better, but they take getting used to.  Where many Swing layout managers happily ignore min/max/pref sizes, JavaFX does not.  If you say you want a control to stretch out to as wide as the container goes, but you forget to set the maxWidth to something big (e.g. MAX_VALUE) the the control won't be allowed to grow wide enough and you will get empty space in the remainder.  You have to unlearn a lot of the stuff you may have gotten used to with Swing, but the result is much more consistent behaviour and better control.  So there was a little "unchaining" and the SceneBuilder tool helps a lot.

From recent messages here I can see that 8.0 will have more abilities for CSS to affect layout, but it may not be something a web developer is comfortable with.  Of course I find that layout in web development has always been a royal pain given browser quirks.  Consider the massive abuse of the <table> element.


On 2013-01-24, at 4:06 AM, Robert Krüger <krueger at lesspain.de> wrote:

> On Wed, Jan 23, 2013 at 11:33 PM, Scott Palmer <swpalmer at gmail.com> wrote:
>> What is the time frame for your conversion?
>> As a complete replacement for Swing, JavaFX 2.x is immature.  There are rough edges.  I started the conversion of a Swing app to JavaFX last year and hit several issues.  Though many of them are minor, they are enough to get in the way of releasing a commercial quality application.  We did find JavaFX too compelling for one aspect of our UI though, so our first release will be Swing + JavaFX (via JFXPanel). JavaFX 8.0 looks to have addressed some of the issues I ran into, and I am evaluating it so that I can get any remaining issues filed ASAP.
> One more question: How was the experience regarding migrating layout
> UI code in your case? We just showed our app to a new developer who
> has a strong background in Web UI development and he felt pity for us
> when we explained what we actually had to do to achieve a certain
> effect in our Look and Feel (Nimbus with some custom extensions) and
> we don't even use animations. Was the move to CSS really like being
> unchained for you in practice compared to Swing layout managers and
> custom L&Fs?
> Thanks in advance,
> Robert

More information about the openjfx-dev mailing list