Java Reference
In-Depth Information
java8Recipes5.setFill(Color.BLACK);
root.getChildren().add(java8Recipes5);
Reflection refl = new Reflection();
refl.setFraction(0.8f);
java8Recipes5.setEffect(refl);
primaryStage.setScene(scene);
primaryStage.show();
Figure 14-3 shows the JavaFX application with various font styles and effects (drop
shadow and reflection) applied to the Text nodes.
Figure 14-3 . Changing text fonts
Solution 2
Make use of the new TextFlow node to assist in stringing rich text together. Use an
FXML file to construct an object graph, and then apply CSS styles to the nodes of the
graph within the FXML. This solution provides a better path for those who are more
comfortable working in a markup language than in Java code. It also demonstrates how
to use a style sheet to declare the styles for your application.
 
 
Search WWH ::




Custom Search