concept stylesheet in category java

This is an excerpt from Manning's book JavaFX in Action.
CSS is a means of fixing this problem, by separating the logical meaning of an element from the way it’s displayed. A stylesheet is a separate document (or a self-contained section within an HTML document) defining rules for rendering the HTML elements. By merely changing the CSS, a web designer can specify the display settings of a paragraph (for example), without need to inject extra style-specific elements into the HTML. Stylesheet rules can be targeted at every node of a given type, at nodes having been assigned a given class, or at a specific node carrying a given ID (see figure 7.14). Untangling the logical structure of a document from how it should be displayed allows the document to be shown in many different ways, simply by changing its stylesheet.
JavaFX allows both programmers and designers to get in on the style act. Each JavaFX control defers not to a stylesheet directly but to a skin. Figure 7.15 shows this relationship diagrammatically. The skin is a JavaFX class that draws the control; it can expose various properties (public instance variables), which JavaFX can then allow designers to change via a CSS-like file format.
Figure 7.15. The data from the control (Progress) and the CSS from the stylesheet are combined inside the skin (ProgressSkin) to produce a displayable UI control, in this example, a progress bar.
![]()
In a rough sense the control acts as the model and the skin as the view, in the popular Model/View/Controller model of UIs. But the added JavaFX twist is that the skin can be configured by a stylesheet. Controls are created by subclassing javafx.scene.control.Control and skins by subclassing Skin in the same package. Another class, Behavior, is designed to map inputs (keystrokes, for example) to host-specific actions on the control, effectively making it a type of MVC controller.