Book Image

Mastering JavaFX 10

By : Sergey Grinev
5 (1)
Book Image

Mastering JavaFX 10

5 (1)
By: Sergey Grinev

Overview of this book

: JavaFX 10 is used to create media-rich client applications. This book takes you on a journey to use JavaFX 10 to build applications that display information in a high-performance, modern user interface featuring audio, video, graphics, and animation. Mastering JavaFX 10 begins by introducing you to the JavaFX API. You will understand the steps involved in setting up your development environment and build the necessary dependencies. This is followed by exploring how to work with the assets, modules, and APIs of JavaFX. This book is filled with practical examples to guide you through the major features of JavaFX 10. In addition to this, you will acquire a practical understanding of JavaFX custom animations, merging different application layers smoothly, and creating a user-friendly GUI with ease. By the end of the book, you will be able to create a complete, feature-rich Java graphical application using JavaFX.
Table of Contents (15 chapters)

Applying styles to JavaFX nodes

Loading a CSS file is not the only option to work with styles. You can also set them directly through an API or specify them in the FXML file. And while this gives additional flexibility, it also requires you to be careful about the priorities of different approaches.

We'll review all the options and see how they interact in the next sections.

Having several CSS files in one JavaFX application

Note that you can use several style sheets simultaneously and apply them not only to Scene but to an instance of the class javafx.scene.Parent (which most JavaFX nodes are, except primitive shapes).

CSS assigned to a Parent will be applied only to this object and all nodes in its children hierarchy...