import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.ListView; import javafx.scene.control.ToolBar; import javafx.scene.layout.AnchorPane; import javafx.stage.Stage; public class Main extends Application { public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage stage) { stage.setHeight(300.0); stage.setWidth(400.0); Scene scene = new Scene(new Group()); AnchorPane pane = new AnchorPane(); ToolBar tb = new ToolBar(); tb.setPrefHeight(60); final ListView lv = new ListView(); Button b = new Button("Add to list"); b.setOnAction(new EventHandler() { public void handle(ActionEvent e) { lv.getItems().add("Item"); //lv.scrollTo(lv.getItems().size() - 1); // Comment this line out to prevent the scrollbar from getting messed up } }); Button b2 = new Button("Scroll to end"); b2.setOnAction(new EventHandler() { public void handle(ActionEvent e) { // Note that this won't work unless you comment out the other call to scrollTo lv.scrollTo(lv.getItems().size() - 1); } }); tb.getItems().addAll(b, b2); AnchorPane.setLeftAnchor(tb, 0.0); AnchorPane.setRightAnchor(tb, 0.0); AnchorPane.setTopAnchor(tb, 0.0); AnchorPane.setTopAnchor(lv, 60.0); AnchorPane.setRightAnchor(lv, 0.0); AnchorPane.setLeftAnchor(lv, 0.0); AnchorPane.setBottomAnchor(lv, 0.0); pane.getChildren().addAll(tb, lv); scene.setRoot(pane); stage.setScene(scene); stage.setVisible(true); } }