O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

In this recipe, we make use of class names and their corresponding CSS selectors to associate components with different styling properties. JavaFX supports a subset of CSS properties and there are different properties applicable to different types of JavaFX components. The JavaFX CSS reference guide (http://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html) will help you identify the supported CSS properties.

All the scene graph nodes extend from an abstract class, javax.scene.Node. This abstract class provides an API, getStyleClass(), which returns a list of class names (which are plain String) added to the node or the JavaFX component. As this is a simple list of class names, we can even add more class ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required