Advanced Synth
By Michael Abernethy2005-04-16
Conclusion
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.
First published by IBM DeveloperWorks
|
|||||||||
You might also want to check these out:
|
Leave a Comment on "Advanced Synth"
You must be logged in to post a comment.
Link to This Tutorial Page!

