0N/A<HTML>
0N/A<HEAD>
0N/A <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
0N/A <META NAME="GENERATOR" CONTENT="Mozilla/4.02 [en] (X11; U; SunOS 5.6 sun4u) [Netscape]">
0N/A <TITLE>Java L&amp;F</TITLE>
0N/A</HEAD>
0N/A<BODY>
0N/A
0N/A<H1>
3835N/AAbout the Java L&amp;F</H1>
3835N/AThe Java Look and Feel is a cross-platform look &amp; feel being provided by Javasoft.
3835N/AHere is some information about the Java L&amp;F you might find useful.
0N/A
3835N/A<P>The Java L&amp;F implements all of the basic Swing functionality,
0N/Abut also extends it in several areas including:
0N/A<UL>
0N/A<LI>
0N/AThemes</LI>
0N/A
0N/A<LI>
0N/ASliders</LI>
0N/A
0N/A<LI>
0N/AToolbars</LI>
0N/A
0N/A<LI>
0N/ATrees</LI>
0N/A</UL>
0N/A
3835N/A<P/>
0N/A<H1>
0N/AThemes</H1>
3835N/A<P>One of the first things we learned while implementing the Java L&amp;F
0N/Awas than many developers feel very strongly about how colors are used in
0N/Atheir software. To help accommodate this we created a Theme mechanism
0N/Awhich allows a developer to easily specify the default colors, fonts and
3835N/Aicons used by the L&amp;F.</P>
0N/A
0N/A<P>The theme mechanism is designed to allow developers to create
0N/Atheir own themes. For an example of this, see the themes
3835N/Awhich are included with Metalworks. Note, like all of the L&amp;F packages,
0N/Athe metal package is not yet frozen and the theme mechanism may change as
0N/Awe get developer feedback on how to improve it.</P>
0N/A
0N/A<H1>
0N/ASliders</H1>
3835N/A<P>There are several areas where the Java L&amp;F introduces some optional
0N/A"value-added" features above the base line capabilities of swing.&nbsp;
0N/AOne is the option of Filled Sliders. These are ideal for things like
3835N/Avolume controls. To access the Java L&amp;F "value-added" features you
0N/Apass in a token to the component's putClientProperty method.&nbsp;Here
0N/Ais an example:</P>
0N/A
0N/A<PRE>
0N/AJSlider slider = new JSlider();<BR>
0N/Aslider.putClientProperty("JSlider.isFilled",
0N/A Boolean.TRUE);<BR> <BR>
0N/A</PRE>
0N/A
0N/A<P>Note that if a UI such as Windows or Motif encounters a property such as
0N/AJSlider.fill which is does not understand that property will be ignored.&nbsp;
0N/AThus you don't have to worry about problems which could arise if you switch
3835N/Ato a different L&amp;F.</P>
0N/A
0N/A<H1>
0N/AToolBars</H1>
0N/A<P>Many popular applications support "roll-over" effects on buttons in toolbars.
3835N/AThe Java L&amp;F provides an easy way to do this. Here is a code snippit:</P>
0N/A
0N/A<PRE>
0N/AJToolBar toolbar = new JToolBar();<BR>
0N/A
0N/A// add your buttons here<BR>
0N/A
0N/Atoolbar.putClientProperty("JToolBar.isRollover",
0N/A Boolean.TRUE);<BR>
0N/A</PRE>
0N/A
0N/A<P>This will remove the borders from around all the buttons in the tool
0N/Abar, and only show them when the mouse is over a given button.&nbsp; This
0N/Ais a nice effect for many applications.</P>
0N/A
0N/A<H1>
0N/ATrees</H1>
3835N/A<P>Java L&amp;F allows you to control the line style used in the JTree component. Here are some code snippits:</P>
0N/A
0N/A<PRE>
0N/AJTree myTree = new JTree();
0N/A
0N/A// This will provide parent-child connector lines
0N/AmyTree.putClientProperty("JTree.lineStyle",
0N/A "Angled");
0N/A
0N/A// This will remove lines from the tree
0N/AmyTree.putClientProperty("JTree.lineStyle",
0N/A "None");
0N/A
0N/A// This will provide lines separating root notes
0N/A// it is the default setting
0N/AmyTree.putClientProperty("JTree.lineStyle",
0N/A "Horizontal");
0N/A</PRE>
0N/A
3835N/A<P><A HREF="toc.html"><IMG alt="Back" SRC="back.gif" BORDER=0 HEIGHT=22 WIDTH=42 ALIGN=BOTTOM>Back</A>
0N/A</BODY>
0N/A</HTML>