/* * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. */ 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; public class JavaFXApplication3 extends Application { @Override public void start(Stage primaryStage) { Label label = new Label("Label 1"); label.setId("red_2"); VBox root = new VBox(30); root.getChildren().addAll(label); Scene scene = new Scene(root, 300, 250); scene.getStylesheets().add(getClass().getResource("/styles.css").toExternalForm()); primaryStage.setTitle("Hello World!" + VersionInfo.getRuntimeVersion()); primaryStage.setScene(scene); primaryStage.show(); } /** * The main() method is ignored in correctly deployed JavaFX application. * main() serves only as fallback in case the application can not be * launched through deployment artifacts, e.g., in IDEs with limited FX * support. NetBeans ignores main(). * * @param args the command line arguments */ public static void main(String[] args) { launch(args); } }