Summary
Swing is enjoying a renaissance, thanks in part to renewed interest in rich-client applications, and also because of new frameworks that aim to ease Swing development. One such framework, JAXX, lets you describe a Swing UI via XML, and even allows CSS stylesheets to define the appearance of Swing components.
Advertisement
Server-side Java sports numerous frameworks built on top of J2EE to help encapsulate common application concerns, making the development process more effective. Client-side Java frameworks started to emerge much slower: Only in the past two years did client-side frameworks finally start to simplify rich-client Java development.
One such framework, JAXX, allows you to specify a Swing UI in XML:
JAXX enables you to write simple XML files describing components and their interactions, and then compile those XML files into ordinary Java classes. User interface components can be developed much faster and more easily in JAXX than in ordinary Java code.
Among the more interesting aspects of JAXX is that it lets you specify the appearance of a Swing component vis CSS. A recent post by Ethan Nicholas describes how to do this. Given a UI component named Calculator, the following JAXX code can be specified:
The more usual Swing approach to changing a component's look-and-feel is to specify, well, a new look-and-feel for your application. Using CSS is a more direct approach, but I always had the sense that using XML to describe UIs creates GUIs that look generic, not to mention that introducing XML can make Swing development even more complex. However, JAXX's approach might still be useful, since CSS is so widely used.
What do you think of JAXX's approach to Swing styling?