/* * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. */ package bugs.richtext; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.scene.text.Text; import javafx.scene.text.TextFlow; import javafx.stage.Stage; /** * * @author Andrey Glushchenko */ public class RichTextBoundsTestApp extends Application { @Override public void start(Stage stage) throws Exception { HBox root = new HBox(); root.setFillHeight(false); addGrid(root, new TextFlow(new Text("Text in Flow"))); addGrid(root, new TextFlow(new Label("Label in Flow"))); addGrid(root, new Label("Test Label")); addGrid(root, new Group(new Text("Text in Group"))); addGrid(root, new VBox(new Text("Text in VBox"))); Scene scene = new Scene(root, 500, 500); stage.setScene(scene); stage.show(); } private void addGrid(HBox root, Node testNode) { GridPane gp = new GridPane(); testNode.setStyle("-fx-border-color: blue;"); gp.addRow(0, testNode); gp.setStyle("-fx-border-color: red;"); root.getChildren().add(gp); } public static void main(String[] args) { launch(args); } }