O'Reilly logo

JavaFX 1.2 Application Development Cookbook by Vladimir Vivien

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

Styling your applications with CSS

In previous recipes, we have seen how to control the look and feel of JavaFX graphical nodes programmatically by setting property values on the node directly. Programmatic style manipulation works just fine, but is hard to externalize. If you want to update the look of your application, you must recompile. However, JavaFX also offers a way to declare styles using Cascading Style Sheets (CSS). This recipe shows you how to apply styles declaratively to JavaFX graphical nodes using CSS.

Getting ready

Before going through this recipe, you should have an idea of what CSS is and how it is used for designing HTML web pages. Similar concepts are discussed here and other CSS-related recipes in this chapter. CSS was created ...

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