Back on topic, Swing Clarity borrows behavior from popular Javascript libraries like Prototype and JQuery, it even provides JQuery-like CSS selector methods -> $() and $$(). Creating a Groovy friendly wrapper for this library is quite simple, as a matter of fact there is a new builder on the works: CSSBuilder. This class is responsible for handling a new attribute that can be placed on any SwingBuilder node: cssClass, this attribute has the same effect as class has on an HTML element. Another thing the builder does is inject the following methods to the java.awt.Container class
- $(String name) -> finds a JComponent by name
- $s(String... names) -> finds all JComponents whose names match the parameters
- $$(String selector) -> finds all JComponents using a CSS selector

I'm sorry for the bright colors, I didn't say the image would be pretty, did I?
This little application has been styled using the following stylesheetThis are the required steps for styling the application
1. Copy CSSBuilder and its dependencies into your app's lib directory [http://svn.codehaus.org//griffon/builders/cssbuilder/trunk/]
2. Configure the builder to be used with Griffon's CompositeBuilder, your griffon-app/conf/Builder.config should look like
3. Make sure the style is applied after all the views have been created, place the following code at griffon-app/lifecycle/Startup.groovy
, be mindful that the stylesheet file will be read inside the EDT, the UI will be updated inside the EDT as well. 4. Finally, let's configure a simple view. You have the choice of setting a name: property on a target component or using the new cssClass: attribute
CSSBuilder is still in the early stages, the default CSS properties handled by Swing Clarity are but a small set of CSS2, there are also a few others that can be created specifically for Swing. A Griffon plugin will be available once CSSBuilder makes its first release (hopefully soon!)
A big shoutout goes to Ben & Dion for making this great library!
Keep on Groovying!