import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.ScrollPane; import javafx.scene.layout.TilePane; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; import javafx.stage.Stage; public class ScrollPaneOfTilePane extends Application { @Override public void start(Stage stage) throws Exception { TilePane tp = new TilePane(1,1); tp.setPrefColumns(1); for (int i=0; i < 490; i++) tp.getChildren().add(new Rectangle(30,30, Color.DODGERBLUE)); ScrollPane sp = new ScrollPane(); sp.setNode(tp); stage.setScene(new Scene(sp, 800,800)); stage.setVisible(true); } public static void main(String[] args) { launch(args); } }