Geertjan is a DZone Zone Leader and has posted 457 posts at DZone. You can read more from them at their website. View Full User Profile

Swing: Withering Vine on the JavaFX Branch?

12.22.2008
| 8730 views |
  • submit to reddit
Over on java.net and elsewhere, one can find various discussions that link JavaFX to the dropping of Beans Binding from JDK 7. Perhaps this is most clearly expressed there as follows:

[C]onsidering that JavaFX Script was built to support binding, maybe it's not a stretch to think that someone, somewhere decided that it's more practical for developers to adopt the built-to-bind JavaFX, than to try to bring the feature to Swing apps. 

If that is indeed the case, it is at least worth being aware of. JavaFX may not be Swing 2.0 in fact, but it may be so in deed. In other words, if one looks inside the code, and uses it, one (at the very least, me) does not feel that one is using Swing at all. I don't necessarily think that is a bad thing. However, if the politics behind the scenes consists of hoping that Swing will gradually be abandoned for JavaFX or—even more likely—that newbies to Java will (at some point) not be using Swing at all, choosing instead to use JavaFX, it would be good to know about this right now, wouldn't it?

If integration between Swing and JavaFX is an afterthought (or, at least, a secondary thought), which clearly seems to be the case, and if beans binding is not going into the JDK because the hope is that JavaFX will be used instead of Swing (or, by excluding it from the JDK, programmers will be pushed towards JavaFX) then let's hear that loud and clear, right? Similarly, if I'm wrong in understanding that JMF will not be replaced in Swing, but that instead one is expected to use JavaFX Media instead (implying a further push towards JavaFX), I'd be very happy to be corrected on this point.

If Swing is the top part part of the rocket that will fall off while we're all gathering speed into JavaFX... I, for one, would like to know when I should start crawling into the main body of the ship.

AttachmentSize
withering-vine.png59.44 KB
Published at DZone with permission of its author, Geertjan Wielenga.

Comments

Jacek Furmankiewicz replied on Mon, 2008/12/22 - 2:56pm

That blows. Simple. It's plain dumb to add new features to an unproven language with 0% updake while ignoring the main language that is your core jewel and used by 99.999% of your developers.

Where are boundable properties and data binding for Java? You know, that language that most of us make an actual living with and code in all day? 

 

 

Manjuka Soysa replied on Mon, 2008/12/22 - 5:40pm

Beans Binding is half-baked, and as far as I know there have not bee any new releases this year. Sun should have supported something like JGoodies binding - another case of 'not built here' syndrome.

I do agree that in the long term it looks like Sun will let Swing die a slow death.

Andrew McVeigh replied on Mon, 2008/12/22 - 6:09pm in response to: Manjuka Soysa

Sun should have supported something like JGoodies binding - another case of 'not built here' syndrome.

There is *so* much good stuff out there that could have been coopted by SUN if it wanted.  There are excellent timing frameworks, the JGoodies stuff is superb, there are nice 3rd party look and feels, good layout managers, docking frameworks etc etc.  They should have bought or copied a lot of this stuff and refactored back into Swing.   Imagine how nice it would be...

 

Ronald Miura replied on Mon, 2008/12/22 - 7:32pm

If there is so much good stuff, why do it all have to be included in the jre? What's the problem about including it as a third-party library? Why do so many Java people seek so obsessively the standardization of everything?

JeffS replied on Mon, 2008/12/22 - 7:43pm

It seems to me that Swing will be around for a long time.  Of all the stuff I've been reading about JavaFX, it appears to be complentary to Swing, and even integrates with it.  JavaFX also has been termed "Swing2".  But there are a lot of code and apps out there that depend on Swing, not the least of which is NetBeans, which unto itself is critical to JavaFX tooling.  So Swing isn't going anywhere anytime soon.

 That said, I see most new exciting stuff going into JavaFX, going forward.  Now, since JavaFX wraps on top of some Swing libraries, and since JavaFX uses both Java2D and Java3D (and Swing uses those too), Swing will benefit from JavaFX advancement, as a nice byproduct.

 True, Swing is now going to be more of a stable or legacy toolkit going forward.  But it's health is fine, and it's far from dead.

Andrew McVeigh replied on Mon, 2008/12/22 - 7:50pm in response to: Ronald Miura

If there is so much good stuff, why do it all have to be included in the jre? What's the problem about including it as a third-party library? Why do so many Java people seek so obsessively the standardization of everything?

Three reasons to include this stuff:

1. most GUIs need these libraries and having it as standard means that developers can standardise their skillset. e.g. it would prevent the current situation where every project tends to use a different approach.

2. some of the basic libraries costs lots of money (e.g. JIDE, Alloy etc). most people use lower quality alternatives with a commensurate lowering of quality of apps (e.g. opensource apps generally don't use a good L&F or a docking framework)

3. SUN swing people seem intent on recreating this stuff, generally poorly. Including it would remove the need to do costly in-house development.

 

Jean-Francois P... replied on Mon, 2008/12/22 - 8:15pm

Well I think that's pretty clear (to me at least) that Sun wants to push everybody (and first of all, all "old" Swing developers) into the JavaFX direction.

As to the statement "JavaFX=Swing 2.0", I utterly disagree with it: as a Swing developer in Java language, I don't consider JavaFX has anything in common with either Swing the library or Java the language. Why would millions of Java/Swing developers have to:

  1. learn a new language?
  2. learn a new API for GUI?

Personally, I won't:

  • First, because my time is limited to learn 2 new things at the same time
  • Second, because I would consider it a waste all the know-how I have accumulated in bot Java and Swing
  • Third, because I love Swing!
  • Fourth, because even though Java the language lacks support for binding (I don't consider JSR-295 enough to get easy binding, easy binding starts first with enhanced properties support in the language), I can find other options based on Swing (but not on Java, eg Groovy-Griffon, Scala-Swing)

That's a pity that Sun seems to let Swing in limbo (more or less) from now on, but who cares really? Except for some boring bugs, Swing is good enough as a GUI platform, as long as you add to it a multitude of 3rd-party, open source, libraries (eg GlazedLists, SwingX...)

One of my resolutions for 2009 will be to learn Groovy and get familiar with Griffon, I definitly won't go into that JavaFX stuff that Sun wants to force-feed us with (just like geese, that's the right period for "foie gras";-))

Jeroen Wenting replied on Tue, 2008/12/23 - 3:17am in response to: Ronald Miura

[quote=ronaldtm]

If there is so much good stuff, why do it all have to be included in the jre? What's the problem about including it as a third-party library? Why do so many Java people seek so obsessively the standardization of everything?

[/quote]

Extremely well said. And people have been saying it for years, yet Sun (and the JCP) don't ever seem to learn.
Combination of NIH syndrome and a "X has it as standard THEREFORE Java must have it too" attitude I guess.
And of course the flood of "we are allowed to only use core Java" statements from schoolkids on the support forums, which no doubt are misunderstood by some people to indicate that anything outside of the core libraries can't be used in serious development.

 

Collin Fagan replied on Tue, 2008/12/23 - 12:03pm

"we are allowed to only use core Java"

 

 Actually I've worked many places which refuse to use any third party libraries. Either out of fear of some open source licensee. Or the fear of being locked into a constant upgrade/license renewal cycle. In general I support the idea of standardizing an implementation of some commonly used library or framework for inclusion in the JDK.

That said I was very vocal in my dislike for Beans Binding. I did not like the approach they were taking so I'm not sorry to see it go. I completely agree with the statement "easy binding starts first with enhanced properties support in the language".

JeffS replied on Wed, 2008/12/24 - 12:11pm

I've followed few of the JavaFX tutorials, and looked at the demo apps.  My impression is that it's very similar to Flex/Flash, in terms of it's general usage.  IMHO, Flash/Flex are great for animations, movies, and games.  Flex is okay for regular data oriented apps, but these apps feel more like a movie pretending to be a data oriented desktop app.

 JavaFX is the same way.  It seems you have to paint a lot of stuff from scratch (with the easy declaritive syntax), but you're not really using regular desktop components like Windows, containers, buttons, text boxes, drop downs, labels, tabs, and the like.

For that, a regular GUI toolkit is much better.  For that, we have good 'ol Swing.  

Jeroen Wenting replied on Thu, 2008/12/25 - 8:00am in response to: Collin Fagan

[quote=cfagan]

"we are allowed to only use core Java"

 

 Actually I've worked many places which refuse to use any third party libraries. Either out of fear of some open source licensee. Or the fear of being locked into a constant upgrade/license renewal cycle.[/quote]

Being wary is one thing, and a good one (never use GPL'd libraries for example), blindly ignoring anything not made yourself is stupid (classic NIH syndrome).
Apparently those places do not refuse to use a third party compiler and runtime? Doesn't the same thing apply to those after all?

I have encountered such places as well, and usually they can be turned around with the correct arguments (and if not, they will have "standardised" at such an old version of the platform that adding everything and the kitchen sink to it won't help you).

I'm all for standardising specifications, but don't go around and standardise implementations as well.
Or if you do, stop criticising Microsoft for bundling IE and WM player with Windows. They're just standardising the web browser and mediaplayer after all...

Osvaldo Doederlein replied on Fri, 2008/12/26 - 12:27pm in response to: Jeroen Wenting

[quote=jwenting]

I'm all for standardising specifications, but don't go around and standardise implementations as well.

Or if you do, stop criticising Microsoft for bundling IE and WM player with Windows. They're just standardising the web browser and mediaplayer after all...

[/quote]

Not a perfect comparison... for one thing, MSIE is not a certified implementation of any industry standard. It doesn't even do a reasonable effort to be a "reasonaly good" implementation of those standards (HTML, CSS, etc.). Can't compare with the Sun JDK that is a certified impl of JCP specs, validated by a massive compatibility suite. If MSIE was in the same level of standards compatibility, I for one wouldn't mind at all that it's bundled with Windows, provided that the system allows me to install another browser and configure everything to use that browser by default to handle URL links, etc.

Peter Karussell replied on Tue, 2008/12/30 - 2:53pm in response to: JeffS

> For that, a regular GUI toolkit is much better.  For that, we have good 'ol Swing.

Yep, my impression too. I will use JavaFX to create my fancy components and 'import' them into Swing.

But all the good components, e.g. mydoggy, glazedlist, ... which are pure swing components will not be replaced in the near future (I guess 4 years).

Passion Lab replied on Sun, 2012/08/12 - 4:32pm

if I'm wrong in understanding that JMF will not be replaced in Swing, but that instead one is expected to use JavaFX Media instead (implying a further push towards JavaFX), I'd be very happy to be corrected on this point. essayreview.org

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.