The biggest pain point of Substance users, as expressed in the comments on the announcement of release 4.3, is the performance. While this might have been less noticeable for smaller UIs, the users of Substance NetBeans module were especially vocal about the performance issue. As i have already said before, you made your statement very clear, and performance improvements were placed as the top priority for the next release (code named Substance 5).
Following the extensive correspondence with Java2D team (thanks, Dmitri), i have created a new java.net project named LightBeam. LightBeam has a collection of static and dynamic scenarios that are targetting different core Swing components and different interaction scenarios. The static scenarios create a number of components and then render the main frame onto an offscreen buffer. The dynamic scenarios run a number of typical interaction scenarios that involve changing the components or models.
Here is the spreadsheet with the performance improvements on static scenarios. The numbers are milliseconds it takes to render a frame with a number of matching components (buttons, sliders etc) to an offscreen buffer (the smaller, the better).

An average improvement from version 4.3 is by factor of 3.5. As you can see, slider rendering was especially slow in version 4.3. Another important number to notice is the heap memory consumption – it has not grown at all as compared with version 4.3.
And here is the spreadsheet with the performance improvements on static scenarios. The numbers are milliseconds it takes to run a specific scenario and repaint the contents (the smaller, the better).

An average performance improvement from version 4.3 is by factor of 2.5. As before, sliders were especially slow in version 4.3. Note that there is one scenario where the additional visuals provided by Substance prove to be still too costly – in dynamically selecting table rows. This would, obviously, have to be addressed before the final release.
Project LightBeam is targeted at look-and-feel developers that wish to test the performance of their libraries. The SVN repository contains a number of sample scripts that were used in creating the above spreadsheets. It will be extensively used throughout the development of Substance to make sure that there are no performance regressions from this moment forward.
The latest development drop of Substance 5 should be very stable. You’re more than welcome to try it out and report any exceptions, errors or visual inconsistencies on the project forums, mailing lists or in a direct mail. Also, if you’re using NetBeans 6.1, please consider trying out the latest drop of Substance module. It should be noticeably faster, but if you’re experiencing any slowdowns, just right-click on the title bar and select “Show cache stats”. In the new dialog, click “Copy to clipboard” and attach the results to a forum / mailing list posting.
Update – the numbers above are for software unaccelerated rendering. No work has been done yet to analyze and improve the performance on d3d-accelerated pipeline.
Here are some Swing links that you might have missed during this week:
One of Substance users has switched from version 3.3 to the 4.* line, and is now missing his favorite Streetlights skin. Indeed, it has been removed about a year ago in version 4.0. This specific skin was never marked as officially supported, and the reason was simple – the old theming layer was not powerful enough to support a skin that mixes dark and bright colors.
It is difficult to design a pleasant skin that combines dark colors for overall controls and bright colors for active controls (selected, rolled over, pressed, armed). It is more difficult to implement such a skin in a programmatic way, and even more so to properly support animations. With usual bright colors you only need to animate the background fill while the foreground color stays the same (usually black). The dark-bright switch requires animating both foreground and background colors. Also, there are many corner cases that reveal themselves only with this specific combination. For example, using the same bright colors for both inner fill and outer border of a selected button results in a very fuzzy appearance. It is much better to use dark colors for painting borders of brightly-filled buttons.
As i have already mentioned, the new version of Substance (currently under development) as much more powerful theming layer. Now it is possible to bring Streelights back to life, this time with much better and consistent visuals. Here is a thumbnail of the test application running under Streetlights (click to see full size):

You’re more than welcome to read the code behind the Streetlights skin. It is available as part of the Extras pack.
Meet David Qiao, the founder of JIDE Software, as the interview series on Swing, RIA and JavaFX that started with Amy Fowler and Mikael Grev continues.
Tell us a little bit about yourself.
My software career started after I got a bachelor degree in computer science from Nanjing University and a master degree on the same field from SUNY at Buffalo. After “wasting” several years doing MFC and .NET stuffs, I finally found what I love to do and can be proud of – founding JIDE Software back in 2003 and working on Java/Swing and UI design. Since then, I am lucky to ride the new wave of Java desktop and drive JIDE to be one of the leading Swing components and services providers.
You’re writing open-source and commercial Swing components primarily oriented at business applications. How do you think Swing fares as compared to competing toolkits, such as MFC, Delphi, GTK, Cocoa, QT and others?
Swing lacks the basic out-of-box components comparing with other toolkits. It is rare to see a GUI toolkit that doesn’t come with a date chooser component, for example. Swing doesn’t have one. Swing also suffered from relatively more bugs and sluggishness, especially when it affects the basic functionality of a user interface. It didn’t come with a decent built-in GUI designer like Visual Studio or Delphi does. Swing would have been more successful by addressing these three issues early on. Even so, Swing still stood out among all the UI toolkits mainly because of its elegant design, cross platform availability, pluggable L&F and being part of core Java. Things are certainly moving forward in recent years on all three issues. More and more companies are choosing Swing as their UI toolkits. I just hope Sun doesn’t mess up again this time.
Other UI toolkits seem to have much larger variety of professional third-party component suites. Amy Fowler attributes this to the rise of web applications, but it didn’t seem to affect the market of Delphi and .NET components. What are your thoughts?
I believe consumer applications are the driving force for .NET components. What platforms are the consumers using? Windows, period. They don’t care about Linux or Mac (at least a few years ago). .NET is good enough for them. Swing is used largely in enterprise applications inside relatively larger companies. Many companies spent their own developer hours to make custom components and use them internally only. They have larger budget and have a longer release cycle so they can afford to make their own components. I bet this kind of thing will not happen in .NET for a consumer application as the release cycle is short and they just want to buy the components and get it done faster. So I believe this is the reason for large 3rd component market in .NET. I would love to see statistics showing the number and type of applications writing in each toolkit to prove if what I said is correct.
What do you think about Sun’s new direction of client Java towards RIA space with JavaFX?
Great. Technologies are merging. Microsoft introduces Silverlight to light up the web. Adobe introduces Flex to flash up the desktop. It is certainly making sense for Sun to introduce JavaFX to enter the consumer application market. It is a new market for Sun so it really has nothing to loose. However entering new market doesn’t mean giving up existing markets. Sun should continue investing in Swing. Swing is popular among enterprise applications and should be kept that way. I doubt large complex enterprise applications will use JavaFX any time soon. It will still primarily Swing’s market, maybe with some help from SceneGraph. Not even Flex.
Are you planning to wrap your components for easier consumption in JavaFX applications?
Absolutely. It gives JIDE a chance to enter the consumer application market, why not?
Can Swing be considered a premier choice for cross-platform UI development today? Would you recommend Swing for building large long-term business applications?
Of course. As I mentioned above, Swing is already used in many large complex enterprise applications. It is a perfect fit.
Would you want to see your products folded into the core JDK distribution, and why?
I would love to see it. Some of the basic features should be included in JDK. I had a talk at this year’s JavaOne where I mentioned the support for non-contiguous cell selection in JTable. Swing JTable is totally wrong when the cell selection is enabled. JIDE fixed this in JideTable. I would love to contribute the code back to Swing, and for free of course. There are many features or bug fixes in JIDE that I would like to contribute back. Why? Those are basic features that should be included in every UI toolkit. It is already a mistake that we had to add those features ourselves.
Is there anything else you would like to add?
We mentioned on our website that “Thousands and thousands of developers’ valuable hours are wasted on building the same component which has been built elsewhere. Why don’t you focus on the most value-added part of your application and let us build those commonly used components for you?” Believe it or not, it is true. Many developers wrote their own general purpose Swing components. Raise your hand if you do! I just want to take this chance to say, please use existing components if you can find one, from JIDE, SwingX, or any other open source or commercial component vendors. It will save your money, save your time and accelerate your application development. A healthy third-party component market is very important for any UI toolkits.