- Synth Look and Feel
synth is a
skinnable Java look and feel, which is configured with anXML property file.According to Sun, goals for synth were:
* Enable to create custom look without writing any code.
* Allow appearance to be configured from images.
* Provide the ability to customize the look of a component based on its named properties.
* Provide a centralized point for overriding the look of all components.
* Enable custom rendering based on images, or user-defined Javadoc:SE|javax/swing/plaf/synth|SynthPainters.History
synth is available beginning with version J2SE 5.0 of Java (see
Java version history ).Java upcoming Java SE 6 Update 10 release (which was called "Consumer JRE" by Sun) will use "Nimbus", a cross-platform Look and Feel implemented with synth, as the default Look and Feel [cite web
url=https://jdk6.dev.java.net/6uNea.html
title=Welcome to the Java SE 6 Update N Early Access Program!
publisher=Sun Microsystems
accessdate=2007-11-01] [cite web
url=http://java.sun.com/developer/technicalArticles/javase/consumerjre/#Nimbus
title=Consumer JRE: Leaner, Meaner Java Technology
publisher=Sun Microsystems
last=Haase|first=Chet
date=May 2007
accessdate=2007-11-01] .Architecture
Synth is a skinnable look and feel in which all painting is delegated to the components, without having to write any code (see Javadoc:SE|package=Synth Look and Feel|javax/swing/plaf/synth).
However synth does not provide a default look, and components that are not defined in the synth
XML file will not be painted. It is however possible to assign a default style to all other widgets, and customize styles for some specific widgets only.Example
The following XML declaration defines a style named textfield and binds it to all text fields. The "defaultStyle" allows to set a default font, foreground and background colors to all other widgets.
Supposing that the XML declaration is defined in a file named "synthExample.xml", the following code loads the XML definition file and sets the current look and feel to synth (loading a synth Look and Feel is done using the "load" method of the Javadoc:SE|javax/swing/plaf/synth|SynthLookAndFeel class):
ee also
* Swing, the standard cross-platform
widget toolkit for Java
*Pluggable look and feel
* Look and Feel in Widget ToolkitsReferences
External links
* API documentation
* [http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/plaf/synth/doc-files/synthFileFormat.html synth file format]
* [http://javadesktop.org/articles/synth/ synth tutorial]
* [http://www.ibm.com/developerworks/java/library/j-synth/ another synth tutorial]
* [https://nimbus.dev.java.net/ nimbus home page]
* [http://www.javasoft.de/jsf/public/products/synthetica Synthetica - commercial Synth Look and Feel with many different themes]
Wikimedia Foundation. 2010.