Java Reference
In-Depth Information
-fx-font-size: 30px;
}
.span1 {
-fx-color: "red";
}
.span2 {
-fx-font-family: "Serif";
-fx-font-size: 30px;
-fx-color: "red";
}
.span3 {
-fx-font-family: "Serif";
-fx-font-size: 30px;
-fx-fill: "orange";
-fx-font-style: italic;
}
.cool {
-fx-effect: dropshadow(gaussian, gray, 8, 0.5, 8, 8);
}
Lastly, a standard JavaFX application class is used to instantiate the example. The
following sources are taken from ChangingTextFontsSolution2.java , and
they demonstrate how to load the FXML and construct the stage.
@Override
public void start(Stage stage) throws Exception {
stage.setTitle("Chapter 14-3 Changing Text Fonts
Using TextFlow and FXML");
stage.setScene((Scene)
FXMLLoader.load(getClass().getResource("textfonts.fxml")));
stage.show();
}
The resulting application will render a scene that resembles the result shown in Fig-
ure 14-4 .
 
Search WWH ::




Custom Search