Contents
Synth Look and Feel
synth is a skinnable Java look and feel, which is configured with an XML property file. According to Sun, goals for synth were:
History
synth is available beginning with version J2SE 5.0 of Java (see Java version history). Java SE 6 Update 10 release and newer contain Nimbus, a cross-platform Look and Feel implemented with Synth. However, for backwards compatibility, Metal is still the default Swing look and feel.
Architecture
Synth is a skinnable look and feel in which all painting is delegated to the components, without having to write any code (see ). 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 class):
This article is derived from Wikipedia and licensed under CC BY-SA 4.0. View the original article.
Wikipedia® is a registered trademark of the
Wikimedia Foundation, Inc.
Bliptext is not
affiliated with or endorsed by Wikipedia or the
Wikimedia Foundation.