13. 5.JavaFX 2.xの特徴、主な機能
5-1.SceneGraph(2)
Group root = new Group();
Scene scene = new Scene(root);
Circle circle = new Circle(200.0, 200.0, 300.0, Color.PINK);
root.getChildren().add(circle); // root の子要素としてcircleを追加
BorderPane borderPane = new BorderPane();
root.getChildren().add(borderPane);
Button button = new Button("Open");
borderPane.setCenter(button);
HBox hbox = new HBox(10);
borderPane.setTop(hbox);
Label label = new Label("URL:");
hbox.getChildren().add(label); // hboxの子要素としてlabelを追加
TextBox textBox = new TextBox(40);
hbox.getChildren().add(textBox);