Monday, March 31, 2008

Rich Clients need Rich Components


2008 will be a defining year for desktop Java development. If all goes well, we will see a slew of new libraries and toolkits for developing rich client applications---stuff like video, audio, animation, graphical effects, etc. Combined with performance and ease-of-use enhancements to the Java platform itself, developers should have all of the tools they need to create compelling applications. While I am really excited about the prospect of having all of these new tools available, I'm a little skeptical that they will emerge---at least in a form that will truly inspire developers to create rich applications using Java.

What got me thinking about this today is a side project I've been working on where I am trying to add validation 'overlays' to components in a form. Kirill at the Pushing Pixels blog has compiled a fairly comprehensive set of ways to accomplish validation overlays. After going through his examples, I got to thinking that all of the solutions are overly complex. But first, let me explain what a validation overlay is. A validation overlay is basically a visual decoratation of an input component with an icon or some other graphical indicator to inform a user that the value in the field is invalid. For my project, I wanted to apply a blurred red border to a text field. To achieve this, I used the LayeredPane approach as described in Kirill's blog. This works great until you resize the form or place the text field in a scroll pane. There are too many quirks that make this approach very unfriendly. There are other approaches (using a JXLayer or JGoodie's IconFeedbackPanel) but, in my opinion, they are still too complex.

Here's my point: Rich Clients need Rich Components. Client toolkits should make it easy to develop modern client applications. Achieving rich client effects in Java Swing is currently too cumbersome. I think the JavaFX Platform will address this to a certain degree. But the component-level is what is really lacking in Swing. Things like text fields, dropdown boxes, sliders, lists, and tables. These components look and behave as if they were designed in the year 2000 (which they were, coincidentally). What we need now are simple and flexible ways to, for example, decorate components with validation glyphs or highlights. Or how about providing a stock JList that is animated either by default or as a simple config option. And how about making it pluggable so that the animation or effect can be swapped easily.

Animated lists and field highlights are not new ideas. MacOS has had them for years. I'm not discounting the entire Swing platform as old and busted---it's just in need of some major overhauls to bring it up to par with current UI trends and technologies. And it needs to be done in a way that makes it easy for developers to take advantage of.

3 comments:

Sandra said...

You're the best developer!!

Sandra said...

Hey gangsta! It's time to update your blog; your faithful subscribers demand an update on BOS (Bond on Stuff.

Anonymous said...

Java's an antiquated platform that is best left to the dregs of the development community. Such developers are responsible for the unfortunate sequence of events that led to George Lucas creating "Crystal Skull."