词条 | Synth Look and Feel |
释义 |
}}synth is a skinnable Java look and feel, which is configured with an XML property file.[1] According to Sun, goals for synth were:
Historysynth is available beginning with version J2SE 5.0 of Java (see Java version history).[2] 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.[3]ArchitectureSynth is a skinnable look and feel in which all painting is delegated to the components, without having to write any code (see {{Javadoc:SE|name=Synth Look and Feel|javax/swing/plaf/synth}}).[4] 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. ExampleThe 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): See also
References1. ^{{cite web| url=http://www.javadesktop.org/articles/synth/index.html| quote=Synth is new and provides for the description of the look and feel through an external XML file.| title=The Synth Look and Feel| publisher=javadesktop.org| author=Scott Violet| date=2004-03-26| accessdate=2013-03-09}} 2. ^{{cite web| url=http://www.ibm.com/developerworks/java/library/j-tiger10194/| quote=Synth is new and provides for the description of the look and feel through an external XML file.| title=Taming Tiger: Ocean and Synth meet Metal| publisher=IBM| date=2004-10-19| accessdate=2012-11-13}} 3. ^{{cite web| url=http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/nimbus.html| title=Nimbus Look and Feel (The Java Tutorials > Creating a GUI With JFC/Swing > Modifying the Look and Feel)| publisher=Sun Microsystems| accessdate=2010-07-01}} 4. ^{{cite web| url=http://www.ibm.com/developerworks/java/library/j-synth/| quote=Synth lets developers rapidly create and deploy custom looks for an application by introducing the concept of a "skin" to Java UI programming| title=Advanced Synth| publisher=IBM| date=2005-02-01| accessdate=2012-11-13}} External links
4 : Java (programming language)|Java (programming language) libraries|Java APIs|Widget toolkits |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。