import javafx.application.Application; import javafx.scene.*; import javafx.scene.control.*; import javafx.stage.Stage; public class TreeViewBugRT21563 extends Application { static double SCENE_WEIGHT = 300.0; static double SCENE_HEIGHT = 600.0; static int TABLEVIEW_SIZE = 100; TreeView createTreeView() { TreeItem treeRoot = new TreeItem("Root"); TreeView treeView = new TreeView(); treeView.setShowRoot(true); treeView.setRoot(treeRoot); treeView.setMinSize(SCENE_WEIGHT-10, SCENE_WEIGHT-10); treeView.setMinSize(SCENE_WEIGHT-10, SCENE_WEIGHT-10); treeRoot.setExpanded(true); for (int i=0; i obj = new TreeItem("text tree item " + i); treeRoot.getChildren().add(obj); } return treeView; } @Override public void start(Stage primaryStage) { Stage stage = new Stage(); Group rootGroup = new Group(); Scene scene = new Scene(rootGroup, SCENE_WEIGHT, SCENE_HEIGHT); stage.setScene(scene); stage.sizeToScene(); stage.show(); TreeView treeView = createTreeView(); rootGroup.getChildren().add(treeView); } public static void main(String[] args) { Application.launch(TreeViewBugRT21563.class, args); } }