Swing should take a hint from Avalon
10.04.05 17:17

Iíve been reading a book on the Windows Presentation Foundation (Avalon). When I got to the chapter on panels, I was pleasantly surprised. Panels control their own layout (rather than having multiple layout managers, WPF has multiple panels that have different layout behaviors). The panels available in WPF seem to mirror those in Swing, with many subtle, but powerful advancements. Many of these advancements are glaringly obvious to anyone whoís used Swing more than twice: Why canít you stack more than one thing in the north location of a BorderLayout? Why canít you specify that the sides get control of the corners in BorderLayout rather than the top and bottom? Why does GridLayout always have to stretch my components? There are many of these simple little annoyances that drive developers directly to using GridBag for everything (or adopting a third party library).

Sun believes they are just setting the groundwork with Swing, and leave it to the third party developers to make further advances. I find this to be a cop out. Why canít Sun spend a couple weeks of man hours to clean up the existing layout managers. They already have things 80% there (they were good enough for Microsoft to copy from). But for years weíve seen no improvements from Sun (Spring doesnít count as an advance - a step backwards, maybe). If Sun wants us to believe that Swing isnít dead, maybe they should stop treating it like it already is.

Comments (2)