< prev index next >

modules/javafx.controls/src/main/java/javafx/scene/control/package.html

Print this page




  80     and getMaxHeight functions are delegated directly to the Skin. The
  81     baselineOffset method is delegated to the node of the skin. It is not
  82     recommended that subclasses alter these delegations.</p>
  83 
  84     <h2>Styling Controls</h2>
  85 
  86     <p>There are two methods for customizing the look of a Control. The most
  87     difficult and yet most flexible approach is to write a new Skin for the
  88     Control which precisely implements the visuals which you
  89     desire for the Control. Consult the Skin documentation for more details.</p>
  90 
  91     <p>The easiest and yet very powerful method for styling the built in
  92     Controls is by using CSS. Please note that in this release the following
  93     CSS description applies only to the default Skins provided for the built
  94     in Controls. Subsequent releases will make this generally available for
  95     any custom third party Controls which desire to take advantage of these
  96     CSS capabilities.</p>
  97 
  98     <p>Each of the default Skins for the built in Controls is comprised of
  99     multiple individually styleable areas or regions. This is much like an
 100     HTML page which is made up of &lt;div&gt;&apos;s and then styled from
 101     CSS. Each individual region may be drawn with backgrounds, borders, images,
 102     padding, margins, and so on. The JavaFX CSS support includes the ability
 103     to have multiple backgrounds and borders, and to derive colors. These
 104     capabilities make it extremely easy to alter the look of Controls in
 105     JavaFX from CSS.</p>
 106 
 107     <p>The colors used for drawing the default Skins of the built in Controls
 108     are all derived from a base color, an accent color and a background
 109     color. Simply by modifying the base color for a Control you can alter the
 110     derived gradients and create Buttons or other Controls which visually fit
 111     in with the default Skins but visually stand out.</p>
 112 
 113     <p>As with all other Nodes in the scenegraph, Controls can be styled by
 114     using an external stylesheet, or by specifying the style directly on the
 115     Control. Although for examples it is easier to express and understand by
 116     specifying the style directly on the Node, it is recommended to use an
 117     external stylesheet and use either the styleClass or id of the Control,
 118     just as you would use the "class" or id of an HTML element with HTML
 119     CSS.</p>
 120 


  80     and getMaxHeight functions are delegated directly to the Skin. The
  81     baselineOffset method is delegated to the node of the skin. It is not
  82     recommended that subclasses alter these delegations.</p>
  83 
  84     <h2>Styling Controls</h2>
  85 
  86     <p>There are two methods for customizing the look of a Control. The most
  87     difficult and yet most flexible approach is to write a new Skin for the
  88     Control which precisely implements the visuals which you
  89     desire for the Control. Consult the Skin documentation for more details.</p>
  90 
  91     <p>The easiest and yet very powerful method for styling the built in
  92     Controls is by using CSS. Please note that in this release the following
  93     CSS description applies only to the default Skins provided for the built
  94     in Controls. Subsequent releases will make this generally available for
  95     any custom third party Controls which desire to take advantage of these
  96     CSS capabilities.</p>
  97 
  98     <p>Each of the default Skins for the built in Controls is comprised of
  99     multiple individually styleable areas or regions. This is much like an
 100     HTML page which is made up of {@literal <div>'s} and then styled from
 101     CSS. Each individual region may be drawn with backgrounds, borders, images,
 102     padding, margins, and so on. The JavaFX CSS support includes the ability
 103     to have multiple backgrounds and borders, and to derive colors. These
 104     capabilities make it extremely easy to alter the look of Controls in
 105     JavaFX from CSS.</p>
 106 
 107     <p>The colors used for drawing the default Skins of the built in Controls
 108     are all derived from a base color, an accent color and a background
 109     color. Simply by modifying the base color for a Control you can alter the
 110     derived gradients and create Buttons or other Controls which visually fit
 111     in with the default Skins but visually stand out.</p>
 112 
 113     <p>As with all other Nodes in the scenegraph, Controls can be styled by
 114     using an external stylesheet, or by specifying the style directly on the
 115     Control. Although for examples it is easier to express and understand by
 116     specifying the style directly on the Node, it is recommended to use an
 117     external stylesheet and use either the styleClass or id of the Control,
 118     just as you would use the "class" or id of an HTML element with HTML
 119     CSS.</p>
 120 
< prev index next >