[quote=“gouessej”]
Well, I too like Java2D and Swing. I like the visual cleanness of Swing and don’t need the eye-candy style of JavaFX’s UI. I’m sure that Swing can be used for many years. Even if Swing and/or Java2D won’t see new features anymore, it’s a robust API and will stay in Java. Do they ever remove libraries? I wouldn’t know of one.
However hardware accelerated Java2D has always been a bit tricky for me, because it seems you often don’t know if this or that operation is really going to be accelerated or not. For experts this may not be a problem, but average guys like me are usually lost in this aspect.
With JavaFX, SUN (*) made a clean cut: everything in JavaFX is meant to be hardware accelerated from the beginning – or it’s not accelerated at all (it fall-backs to Java2D entirely, and hence no 3D), but no mishmash.
From a) SUN’s and b) us normal programmers’ point of view this new approach makes sense, still, I think: a) SUN can present the eye-candies for the masses who like the fancy stuff. And b) we feed the JavaFX’s scene-graph very differently than we draw to Java2D, so that the scene-graph can be fully accelerated.
That’s how I understand things currently, but I could be wrong. So, for multi-media things, and this includes modest games, I think JavaFX is an attractive option indeed, since it works out of the box without any 3rd party libraries, even on such small Linux devices like the Raspberry Pi – then without the Web- and Video-player components however.
But JavaFX has higher demands for newer hardware, as Julien mentioned. For example, on my nice ~8 year old PC which came with WinXP and a not-so-fast but solid ATI X1300 GPU, JavaFX black-lists the card and so uses software 2D only, and no 3D at all. Since ATI stopped to provide Windos drivers for this card a long time ago, JavaFX on this WinXP computers is useless.
On Linux however things are much better, since is fully supports this card, with the X.Org’s R300 driver using the “Gallium 0.4 on ATI RV515” renderer. I’ve to say I’m deeply impressed.
And so, with Linux, you can also overcome JavaFX’s strange black-list which blocks a lot of cards: just use the “-Dprism.forceGPU=true” parameter to ignore the black-list, and JavaFX runs smooth and nicely also on this older PC via OpenGL-ES2.
However, I realise that there’s many other cards which may not play so nice even with forceGPU, for example because of Windows (XP). And here I think a connection between the solid JOGL and JavaFX would be valuable.
(*) It’s been SUN indeed, since the technical architect of JavaFX, Mr. Richard Bair, was in SUN’s Swing team and they started it at SUN.