The benefit of externalizing CSS is the ability to update the look and feel of your application without having to update the code or recompile. Another attractive aspect of externalizing CSS is to let your users select a preferred theme or applying a skin. In this recipe, we are going to extend the data input form example, used throughout this chapter, to add skinning capabilities with CSS.
The concepts presented here all deal with CSS and externalizing through CSS files. If you have not used CSS, or are unfamiliar with JavaFX's support for CSS, it is recommended that you review the recipe Styling your applications with CSS and Using CSS files to apply styles from this chapter to get acquainted with JavaFX 's implementation of CSS.
This recipe is going to reuse the data form example used throughout the chapter. Refer to the recipe Creating a form with JavaFX controls for a thorough background on this example. In this usage, we...