import javafx.application.Application; import javafx.scene.layout.*; import javafx.scene.*; import javafx.scene.control.*; import javafx.stage.Stage; import javafx.scene.text.*; import javafx.scene.shape.Rectangle; import javafx.scene.paint.*; public class Tall extends Application { @Override public void start(Stage stage) { GridPane root = new GridPane(); for (int i = 0; i < 6; i++) { Text text = new Text("" + (i+1)); text.setFont(new Font(40)); Rectangle rect = new Rectangle(60, 60, Color.SKYBLUE); rect.setStroke(Color.BLACK); StackPane sp = new StackPane(); sp.getChildren().addAll(rect, text); root.add(sp, i % 3, i / 3); } stage.setScene(new Scene(root, 200, 200)); stage.show(); } public static void main(String[] args) { launch(args); } }