Why the excitement about Swing? The authors let O'Reilly Web site editor Allen Noren know why the ability to build state-of-the-art user interfaces is plenty to get excited about.
So what distinguishes Swing? There is of course the issues that we touched on already: 100% Java means portability, and its design allows the ability to reset the look-and-feel of an application at runtime. Swing depends on the event model introduced with Java 1.1, where as the AFC used the event model of Java 1.0. On the downside, Swing is likely to be a little slower than any native libraries put out by Microsoft, especially MFC, because it's written in pure Java. And of course, it's brand new, so there are still some kinks to be worked out.
Swing also provides a rich text framework that allows programmers to do almost anything in six or seven lines of code. I'm extremely glad to see that those classes made it into Swing; this removes a ton of work from creating everything from a simple word processor to an HTML browser.
Copyright © 2009 O'Reilly Media, Inc.