import javafx.application.*; import javafx.scene.Scene; import javafx.scene.layout.VBox; import javafx.scene.text.*; import javafx.stage.Stage; public class TestFont extends Application { @Override public void start() { Stage stage = new Stage(); VBox vb = new VBox(); Scene scene = new Scene(vb); stage.setScene(scene); vb.getChildren().add(new Text("A quick brown fox jumps over lazy dog") {{ setFont(Font.font("Times New Roman", FontPosture.ITALIC, 20)); }}); vb.getChildren().add(new Text("A quick brown fox jumps over lazy dog") {{ setFont(Font.font("Times New Roman", 20)); }}); stage.setVisible(true); } public static void main(String args[]) { Launcher.launch(TestFont.class, args); } }