import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.control.ScrollPane; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class ScrollPaneOfLabels extends Application { @Override public void start(Stage stage) throws Exception { VBox vb = new VBox(1); for (int i=0; i < 100; i++) vb.getChildren().add(createLabel()); ScrollPane sp = new ScrollPane(); sp.setNode(vb); stage.setScene(new Scene(sp, 800,800)); stage.setVisible(true); } public static Label createLabel() { Label l = new Label("This is a Label"); l.setStyle("-fx-padding: 20px; -fx-background-color: cyan;"); return l; } public static void main(String[] args) { launch(args); } }