📄 metal.html
字号:
<HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <META NAME="GENERATOR" CONTENT="Mozilla/4.02 [en] (X11; U; SunOS 5.6 sun4u) [Netscape]"> <TITLE>Java L&F</TITLE></HEAD><BODY><H1>About the Java L&F</H1>The Java Look and Feel is a cross-platform look & feel being provided by Javasoft.Here is some information about the Java L&F you might find useful.<P>The Java L&F implements all of the basic Swing functionality,but also extends it in several areas including:<UL><LI>Themes</LI><LI>Sliders</LI><LI>Toolbars</LI><LI>Trees</LI></UL></P><H1>Themes</H1><P>One of the first things we learned while implementing the Java L&Fwas than many developers feel very strongly about how colors are used intheir software. To help accommodate this we created a Theme mechanismwhich allows a developer to easily specify the default colors, fonts andicons used by the L&F.</P><P>The theme mechanism is designed to allow developers to createtheir own themes. For an example of this, see the themeswhich are included with Metalworks. Note, like all of the L&F packages, the metal package is not yet frozen and the theme mechanism may change as we get developer feedback on how to improve it.</P><H1>Sliders</H1><P>There are several areas where the Java L&F introduces some optional"value-added" features above the base line capabilities of swing. One is the option of Filled Sliders. These are ideal for things likevolume controls. To access the Java L&F "value-added" features youpass in a token to the component's putClientProperty method. Hereis an example:</P><PRE>JSlider slider = new JSlider();<BR>slider.putClientProperty("JSlider.isFilled", Boolean.TRUE);<BR> <BR></PRE><P>Note that if a UI such as Windows or Motif encounters a property such asJSlider.fill which is does not understand that property will be ignored. Thus you don't have to worry about problems which could arise if you switchto a different L&F.</P><H1>ToolBars</H1><P>Many popular applications support "roll-over" effects on buttons in toolbars. The Java L&F provides an easy way to do this. Here is a code snippit:</P><PRE>JToolBar toolbar = new JToolBar();<BR>// add your buttons here<BR>toolbar.putClientProperty("JToolBar.isRollover", Boolean.TRUE);<BR></PRE><P>This will remove the borders from around all the buttons in the toolbar, and only show them when the mouse is over a given button. Thisis a nice effect for many applications.</P><H1>Trees</H1><P>Java L&F allows you to control the line style used in the JTree component. Here are some code snippits:</P><PRE>JTree myTree = new JTree();// This will provide parent-child connector linesmyTree.putClientProperty("JTree.lineStyle", "Angled");// This will remove lines from the treemyTree.putClientProperty("JTree.lineStyle", "None");// This will provide lines separating root notes// it is the default settingmyTree.putClientProperty("JTree.lineStyle", "Horizontal"); </PRE><P><A HREF="toc.html"><IMG SRC="back.gif" BORDER=0 NATURALSIZEFLAG="3" HEIGHT=22 WIDTH=42 ALIGN=BOTTOM>Back</A></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -