-
Book Overview & Buying
-
Table Of Contents
JavaFX 1.2 Application Development Cookbook
By :
As your application grows beyond a few GUI components, you will find it cumbersome and impractical to use inline CSS directives to apply styles. Similar to HTML documents, the JavaFX platform provides the necessary mechanism to externalize style declarations in one or more CSS files. In this recipes we will explore how to create and attach a CSS file to your applications.
Before you go through this recipe, you should have an idea of what CSS is and how it is used. Review the previous recipe Styling your applications with CSS to get an idea of how JavaFX CSS works. You will create a simple application and an accompanying stylesheet file. We will examine how the elements are styled using the declared styles in the CSS file.
For this recipe, we are going to create a simple application.
1. The following is the code for the application that will be styled. The full listing of the code for the application can be found in ch04/source...
Change the font size
Change margin width
Change background colour