package test.scenegraph.app; /* * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. */ import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; import javafx.scene.text.Font; import javafx.scene.text.Text; import javafx.stage.Stage; /** * * @author shubov */ public class ShortAppWithoutDependencies2 extends Application { private Pane pageContent; protected final static int width = 850; protected final static int height = 650; Scene scene; public Text createTestText() { Text text123 = new Text(" this text has setFont(newFont(30)) "); text123.setFont(new Font(30)); return text123; } protected void fillScene() { Group gr = new Group(); scene = new Scene(gr, -1, -1, true); VBox vBox = new VBox(); pageContent = new Pane(); vBox.getChildren().add(createTestText()); vBox.getChildren().add(pageContent); ((Group) scene.getRoot()).getChildren().add(vBox); } public void start(Stage stage) { stage.setWidth(width); stage.setHeight(height); fillScene(); stage.setScene(scene); stage.show(); VBox lines = new VBox(); pageContent.getChildren().add(lines); lines.getChildren().add(new Text(" some text ")); lines.getChildren().add(createTestText()); } public static void main(String[] args) { launch(ShortAppWithoutDependencies2.class, args); } }