import com.sun.javafx.runtime.VersionInfo; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.BorderPane; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class JavaApplication10 extends Application { @Override public void start(Stage stage) throws Exception { BorderPane root = new BorderPane(); final Label label1 = new Label("Hello World!"); label1.getStyleClass().add("l"); label1.setStyle("-fx-font-family:Arial;-fx-font-weight:bold;"); root.setCenter(new VBox(30){{getChildren().addAll(label1);}}); Scene scene = new Scene(root, 500, 500); javafx.scene.text.Font.loadFont(getClass().getResourceAsStream("tangerine.ttf"), 12); scene.getStylesheets().add(getClass().getResource("styles.css").toExternalForm()); stage.setScene(scene); stage.show(); stage.setTitle(VersionInfo.getRuntimeVersion()); } /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } }