Skip to main content

Guys, don't panic - Swing is here to stay

Posted by fabriziogiudici on November 6, 2008 at 5:20 PM PST

The announce of Sun stopping funding of SwingX is spreading some irrational fears. I'm in the worst moment to blog about that, but I'd like to put some things clear immediately (for this reason I'm not commenting on Kirill's blog - sorry Kirill, I hope this doesn't sound rude, but I don't have the time to follow discussions and answer to others - let's hope for the weekend).

  1. We know that Sun is not in good shape from the financial point of view and there's the planetary financial storm. Unfortunately, and this is sad, this implies that the corporate has to cut fundings in many places
  2. Sun stopped funding SwingX, not Swing. SwingX is however an open source project and if people like it, should just keep on supporting it. Pardon my frankness: Sun for sure makes a lot of communication errors, it must improve the interface with the community, but too many people saw Java opensourcing as a "Santa Claus moment": Sun speding lot of money and delivering free software to people. It's not the way opensource works. If you like SwingX and use it, and if it's strategic to you, consider funding the developers, Jeanette and the others. It's the way opensource works: let's not forget that it's still a market thing.
  3. The recurrent point that Sun pays too much attention to backward compatibility (and Kirill himself points out this) should make it clear that nobody is thinking about withdrawing Swing from the core of Java. Consider also that NetBeans, which is one of the products where Sun most invested in the recent two years, is completely based on Swing.
  4. Sun is clearly focusing most of the remaining resources on JavaFX. You might like it or not, but it seems natural: they have bet on it and the project can't fail, or Sun would lose the face. JavaFX is in delay, but it's going on. The core libraries are still part of Java2D, which is the Swing container. Java 6U10 delivered many new features for Swing, including Nimbus. (edited to add) This means that we have new features for Swing, even though they are delivered for JavaFX.

So, please don't panic. Swing is here and will stay. SwingX is here and will stay if people support it. It's the open source thing, baby.


RIA will be everywhere and thus Swing might not be the framework of the future. Still swing has many good sides in it. In my opinion - combination of swing-like development model with Ajax as a (hidden) rendering layer and ui-logic on the server-side is the best choice for many applications. In order to look what is possible with this model, see (Open Sourced) IT Mill Toolkit:

Many of java swing people are form my point of vue to focused (linked) on this API to understand more. -> Yes Swing is a bit difficult to program. I hava tried 2 days to use javaFx.And yes it is easier in many ways to build Guis. --> So many Swing people are today complaning in blog comments ... Oh yea ? From my point of vue those people should have complained for ages: Swing look and fell has not much changed since 2001... while Internet sites have had a dramatic improvment in the look and feel. And people complain today with javaFx ? But dam this javaFx will put back java on the client guies. Just do not complain now that Sun is doing something (update N). - From my point of Vue Sun with javaFx is making us java-swing-developper a toolbox to compet with Flash. Never again my Internet collegues (Flash, html, javascript) will smile at me with my java knowledg. What did they told me the other day: "people using Swing are ingeneers have vision impairness" (sorry for my poor English ). With javaFx I feel I can go back to the Web service development.

The truth is that Sun competes with MS. Sun had to offer more swing components and look and feels years ago. I do not understand that free platform when 90% companies had to buy JIVE components that are not very complex to do comparing to current 6000 job loss. With a good GUI support and 3D (OpenGL binding for Java not Java3D, do not invest the wheel) support Java could be competitor to Windows. M$ was understanding it much better then Sun. I like Java/POJO and JEE was a mistake. How could they make Java Server Faces a standard!

10 years before, Sun was too early to press RIA with Applet. 10 years after, Sun was too late to press RIA with JavaFX. I don't think I'll use JavaFX. And I don't think it will not be a success RIA. But I think that Sun can try. JavaFX will benefit feature improvement on Swing/JMF. JavaFX will be useful, IF it is the widely used in Netbeans it self. They will find what's the problem with it and fix it. We will have a standard of describe the GUI in Java (even if another JSR to replace the JavaFX later). --- JavaFX is "programming" the GUI. but not simply describe it statistically. Personally, I prefer something like XUL even XAML over JavaFX. I don't see how JavaFX can abstract the UI to "any implementation". There is an implementation that can almost render XAML in Swing and SWT already. --- Please correct me if I wrong. Is JavaFX Script more like "the ActionScript in Flash", but it isJava rather then ECMAScript ?

> no one seems to care about using JavaFX script Read the comments just above yours. There are tons and tons of people who care about JavaFX script. Even more than those who don't care for it. Want numbers to back that statement up? Like you, I have none. > Swing will be left to die with no new features or bug fixes. Yeah, and Ruby is taking over Java. I highly doubt that Sun will not do bug fixes, or new features for Swing in the future. Just look at Nimbus, or the new media features being delivered from JavaFX. Swing can benefit from that. The way I see it, everything being done for JavaFX is built on top of Swing, Java2D, Java3D, etc. so it benefits everyone.

Sun's financial problems are a legitimate concern. We'll need to find a more efficient way to work on these vital features. That being said, I somewhat agree with some of the comments that have been made about JavaFX (the script at least): it's nice in the sense that Sun is focusing on the desktop, but no one seems to care about using JavaFX script. Most people would love to work on a pure Java-based solution. I don't believe anyone has implies that Swing will be withdrawn by Sun, but rather that it will be left to die with no new features or bug fixes.

JSR 295 and JSR 296 (Beans Binding and Application Framework) are what we Swing developers want Sun to be focusing on... instead Sun returns to compete in a space where they already failed (applets) when the competition is even stronger (AIR, Silverlight) Seems odd. JavaFX looks interesting for only one reason: It can possibly allow our graphic designers to produce a full usable interface that we can attach to our Swing applications. Currently constructing Swing UIs is too complex for the graphic designers. The ability to mix JavaFX with Swing may allow Swing developers to benefit from some really slick UI designs for a certain class of applications. For that reason I do wish Sun good luck with the success of JAvaFX - Because JavaFX runs on the JVM, it also means that success of JavaFX should lead to easier deployment and faster load times for all Java desktop developers. That is certainly a good thing.

I am also happy about javaFX. Afte all, if I don't like it I won't have to use it.
However I guess it will fill the gap between html-based UIs and Swing based ones.

Good point also about the open-source thing - for now there's only been a lot take take take ... time to give ;)

I am also happy to see JavaFX coming. My primary reason is that I'm currently programming in JSF. If JavaFX can become the open source alternative for delivering RIA, leaving HTML for what it was originally designed for, then it is a major achievement. For everyone who want's to bash Sun because of their efforts to maintain backwards compatibility, just go with MS. I heard they're quite flexible with regards to dropping backwards compatibility (Think MS Office, VB :-)

I for one am happy to see Sun moving in the direction of JavaFX. Having worked with Adobe Flex I see the value in what Sun is doing with this. The binding features you find in the Flex world are an invaluable addition to a UI developer's toolkit. Sun's decision to adopt binding, dump the XML syntax, and create a functional language could turn out to be a very good decision. The preview SDK isn't ready to compete head-on with Flex. But, in combination with Java 6u10, they're making a lot of good moves.

Funny how some commenters assert that nobody wants JavaFX and that it is a toy. Flex and Silverlight are proof that there is a huge market for such a thing and many Java developers including myself are waiting with bated breath for JavaFX.

I don't think that there is fear that we won't see the javax.swing packages any more in the JDK; the worry is Sun is slowing down investments related to Swing. We ask that Sun invests in two core improvements to Swing: Declarative UI Construction (as mentioned above) and built-in data binding (POJOs not Beans).

It's not just taking the axe to Swinglabs that's wound people up it's the lingering questions of what JavaFX means for the future of Swing. The appframework & beansbindings JSRs were abandoned in favour of JavaFXs builtin declaritive nature. But these were belived to be key changes for Swing developers in JDK 7.0. But killing off their test bed for new components and techniques (like painters) that was Swinglabs (started by the sun client team, so the open source aspect is kinda grey, certainly Swinglabs benefited greatly from the Sun seal of approval). It sends the clearest message yet that Swing should be considered API frozen and EOL? Seems the only changes for Swing in 7 is JavaFX which translates to scenegraph (too low level to leverage from swing?) and media playback. Not high on enterprise developers lists and not beansbindings nor appframework. I think the Swinglabs move was just the final insult for a number of us who've been feeling the ill winds for the last 18 months. The lack of communication from Sun certainly hasn't been helpful either, they're official line on the future of Swing remains understandably vague. It's not going anywhere - quite literally. Developers shy away from stale APIs like the Sun (as in daylight). While it won't effect us with large swing applications tomorrow, it won't encourage new developments either. No new users spells death, lingering or no. If they want developers to switch to a whole new language and start over with a new framework the question they'll be asking is why should I trust you now? if I have to start over why not go the whole hog and switch to flex, silverlight? why would I knowingly choose to bet on the underdog with finical difficulties? Fool me once shame you you, fool me twice fool on me.

I'm afraid Sun has already lost face with JavaFX: not up to expectations (as compared with competitors). In addition, Sun has lost "faces" such as Chet, Romain, Hans. And probably -sorry to say so- Sun is already losing money on JavaFX, which looks like something hardly anybody wants or needs. From the beginning I have considered JavaFX a "toy language" that I could hardly use for the kind of applications we (in my company) develop in Swing. Yes that's true that JavaFX efforts have also benefited Swing, but I think Swing deserves more attention for itself. It's a pity to see some important JSR (295, 296) left in limbo. It's a pity that some language evolutions that would benefit Swing a lot (such as property support) didn't seem to go anywhere. I'm sorry to say so guys, but Sun is not Microsoft, it cannot put big bucks on the table for developing "prototypes" while keeping resources on its core assets (and I strongly believe that Swing is one of these). But one thing is true however, it is pointless for us, poor Swing developers, to demonstrate our anger or sorrow, because Sun decisions are not made by people we talk with on forums or blogs, but by board members who probably don't give a sh#t about all that. For my part, I am still a strong Swing supporter; I don't intend to buy in JavaFX; I'd rather take a look at other options (eg Groovy/Griffon or Scala/scala-gui) to make Swing easier to use.

Good post, Fabrizio. Thanks for injecting some common sense into the storm (that rages inside the teacup).

My question is: Why Sun is betting in something nobody wants?, Swing is already mature we just need a declarative way to create GUI or components more easy thats all and for "RIA", not mobile, not TV that is why Java ME is there for mobile. Sun could just save lot of money and effort just to introduce Xul for Swing that is the only thing we Java developers need. We don't need to reinvent all the wheel that JavaFX is doing but half backed. JavaFX I see it as a wasting of money and time for Sun. 2 JavaOne shows and nothing yet, Flash 10 and Silverlight 2 already out and kicking. The important here is the RIA and Enterprise GUI/Desktop development is where the money is right now, IMHO.

> [...] or Sun would lose the face How much more face can Sun afford to lose?!

Thanks for pointing those things out. I have also been told that Swing can be considered as a mature thing.