import com.sun.javafx.runtime.VersionInfo; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.VBox; 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 { VBox root = new VBox(30); Label label1 = new Label("Use family name : Grumpy wizards make toxic brew for the evil Queen and Jack."); label1.getStyleClass().add("class1"); Label label2 = new Label("Use font name : Grumpy wizards make toxic brew for the evil Queen and Jack."); label2.getStyleClass().add("class2"); 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); } }