Helping ordinary people create extraordinary websites!
HOME TUTORIALS SCRIPTS WEB HOSTING BLOG FORUM
Get Our Newsletter
Your Email:

Advanced Synth

By Michael Abernethy
2005-04-16


Conclusion

Synth brings the concept of skins to Swing. Synth's biggest advantage over the traditional method of writing a custom look and feel in Java code is its time savings. An entire Swing look can be created in less than a month, five times more quickly than it takes to code it in the Java language. Or for the ambitious developer, five Synth looks can be created instead of just one Java-coded look.

However, not everything is perfect in the world of Synth. Writing Java code to override the Swing look lets you completely change both the look and feel of an application. Synth only lets you change its look. This is a significant difference. The look is just that -- the colors, fonts, and images used in the application. The feel, on the other hand, corresponds to the behavior that the application shows during interaction -- a right mouse click here, a key press there. For example, if you want to change the behavior of a JList to select items with a left mouse click, and delete them with a right mouse click, you can't do it with Synth. You'd need to write Java code for a new look and feel. Synth should really be called a new Swing look, not a look and feel. You can change a UI's look quickly with Synth, but the feel will always be the default Swing feel.

Still, if you want to spruce up your application by giving it a new look, or have longed to see a Swing application look better than the putrid Metal look -- thank goodness that's history with Java 5.0 -- Synth is a great option. It offers no performance issues and seems relatively bug free. And Sun has already shown that a complete look can be created with Synth by releasing the GTK+ look.

Synth documentation and examples are surprisingly scarce now. Having read this article, you should have a deeper understanding of how Synth works and be able to generate a complete Synth XML document using the one-style-tag-per-one-component design. Synth's inheritance and hierarchy models offer more powerful ways to create style tags, but you can create a complete look without them. Ideally, as Synth knowledge grows, the Swing UI community will begin to see an explosion in the number of skins. With potentially hundreds of looks to choose from, the labels often attached to Swing apps of "horrible looking" and "ugly" -- I don't think I'm being too harsh -- will disappear forever.

Tutorial Pages:
» Custom UIs are a Breeze with the Newest Swing Look and Feel
» Beauty's Only Skin Deep
» Synth Basics
» Demo Application
» Changing a Color and Font
» Using Images
» Handling Different States
» Working with Custom Painters
» More-Advanced Settings
» Examining Synth Performance, Reliability, and Efficiency
» Conclusion
» Resources


First published by IBM DeveloperWorks


 | Bookmark
Related Tutorials:
» All about JAXP, Part 1
» Make Database Queries Without the Database
» Load List Values for Improved Efficiency
» 2 Ways To Implement Session Tracking
» A Simple Way to Read an XML File in Java
» Develop Aspect-Oriented Java Applications with Eclipse and AJDT