From the course: Learning JavaFX GUI Development

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Apply CSS themes

Apply CSS themes

From the course: Learning JavaFX GUI Development

Start my 1-month free trial

Apply CSS themes

- [Voiceover] CSS stands for Cascading Style Sheets. Those of you that have done any HTML programming, you probably know how to use a Cascading Style Sheet already. One of the nice things is that JavaFX automatically includes Cascading Style Sheets support. You may not even have realized this, but JavaFX automatically added a Cascading Style Sheet to all of our programs that we've been doing so far. By using CSS, it allows us to custom style the user interface of a JavaFX application, without changing any of the application source code. It separates the style from the business logic. CSS can be applied to any node in the JavaFX scene graph, and are applied to the nodes asynchronously. JavaFX CSS styles can be easily assigned to the scene at runtime, allowing an application's appearance to change dynamically. It is helpful to create a theme that can be used for all scenes in your application. This provides the user with the consistent look and feel. That's another benefit of CSS…

Contents