May 2018
Intermediate to advanced
268 pages
6h 43m
English
Similar to regular CSS JavaFX supports descendant selectors. You can chain other selectors to limit the scope of the provided style.
Let's slightly enhance the previous example to demonstrate. All the following three styles are applicable to different types of radio buttons in relation to VBox with ID#vb:
/* chapter6/syntax/pseudo-class-demo.css *//* 1. Only direct children of #vb, note the ">" sign */#vb > .radio-button { -fx-font-size: 20 }/* 2. All children of #vb */#vb .radio-button { -fx-underline: true }/* 3. All radio buttons */.radio-button:selected { -fx-text-fill: red }
To better illustrate this, let's use ScenicView (a very useful JavaFX tool that we discussed in Chapter 2, Building Blocks – Shapes, ...
Read now
Unlock full access