import com.sun.javafx.runtime.VersionInfo; import javafx.application.Application; import javafx.application.Platform; import javafx.event.ActionEvent; import javafx.event.Event; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.ButtonBuilder; import javafx.scene.control.Label; import javafx.scene.layout.VBox; import javafx.scene.text.Font; import javafx.stage.Stage; /* * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. */ /** * * @author Sergey Lugovoy */ public class Main extends Application { @Override public void start(Stage stage) throws Exception { final VBox root = new VBox(20); root.getStyleClass().add("root"); Label label1 = new Label("VBox { -fx-font:20px System } > Label "); Label label2 = new Label("Vbox { -fx-font:20px System } > Label { -fx-font-family:Tangerine}"); label2.getStyleClass().add("class"); root.getChildren().addAll(label1, label2); Scene scene = new Scene(root); scene.getStylesheets().add(getClass().getResource("styles.css").toExternalForm()); stage.setScene(scene); stage.setTitle(VersionInfo.getRuntimeVersion()); stage.show(); } public static void main(String[] args) { launch(Main.class); } }