5. public class Hello extends Application {
@Override
public void start(Stage stage) {
// ルートコンテナ
AnchorPane root = new AnchorPane();
// Scene Graph を生成し、ルートコンテナを貼る
Scene scene = new Scene(root);
stage.setScene(scene);
// Scene Graph を構築
stage.show();
}
public static void main(String[] args) {
launch(args);
}
}
7. Stage
Scene
AnchorPane
HBox
TableView
Label TextField Button
8. AnchorPane root = new AnchorPane();
Scene scene = new Scene(root);
stage.setScene(scene);
TableView<Person> table = new TableView<>();
root.getChildren().add(table);
HBox hbox = new HBox();
Label label = new Label("Label");
hbox.getChildren().add(label);
TextField field = new TextField("TextField");
hbox.getChildren().add(field);
Button button = new Button("button");
hbox.getChildren().add(button);
root.getChildren().add(hbox);