ADDITIONAL SYSTEM INFORMATION :
Java : Zulu FX 21.0.2+101
Windows 10 x64
A DESCRIPTION OF THE PROBLEM :
When I perform a scrollTo in a ListView, the scrollBar doesn't go as far as it should
REGRESSION : Last worked in version 8u401
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a new project
Create a listview
Put the listview in a scene
Display the scene
Add items to the listview
Use scrollTo to go to an item in the listview (if the listview is large enough and you try to scrollTo an item at the bottom of the list, the cursor won't go where it should).
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Let ScrollTo return to the way it worked in Java 8, because there were no bugs back then.
ACTUAL -
At the moment, ScrollTo doesn't go low enough. There are still a few pixels and sometimes even a few lines below ScrollTo, even when you ask to Scroll to the last item in the list.
---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.collections.ListChangeListener;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ListView;
import static javafx.scene.input.KeyCode.S;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
public class Test3 extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
ListView listView = new ListView();
Scene scene = new Scene(listView, 400, 400);
primaryStage.setScene(scene);
primaryStage.show();
listView.getItems().clear();
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.scrollTo(listView.getItems().size() - 1);
}
public static void main(String[] args) {
Application.launch(args);
}
}
---------- END SOURCE ----------
FREQUENCY : always
Java : Zulu FX 21.0.2+101
Windows 10 x64
A DESCRIPTION OF THE PROBLEM :
When I perform a scrollTo in a ListView, the scrollBar doesn't go as far as it should
REGRESSION : Last worked in version 8u401
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a new project
Create a listview
Put the listview in a scene
Display the scene
Add items to the listview
Use scrollTo to go to an item in the listview (if the listview is large enough and you try to scrollTo an item at the bottom of the list, the cursor won't go where it should).
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Let ScrollTo return to the way it worked in Java 8, because there were no bugs back then.
ACTUAL -
At the moment, ScrollTo doesn't go low enough. There are still a few pixels and sometimes even a few lines below ScrollTo, even when you ask to Scroll to the last item in the list.
---------- BEGIN SOURCE ----------
import javafx.application.Application;
import javafx.collections.ListChangeListener;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ListView;
import static javafx.scene.input.KeyCode.S;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
public class Test3 extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
ListView listView = new ListView();
Scene scene = new Scene(listView, 400, 400);
primaryStage.setScene(scene);
primaryStage.show();
listView.getItems().clear();
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.getItems().add("Item 1\nItem 2\nItem 3\nItem 4");
listView.scrollTo(listView.getItems().size() - 1);
}
public static void main(String[] args) {
Application.launch(args);
}
}
---------- END SOURCE ----------
FREQUENCY : always
- relates to
-
JDK-8296871 TableView scrollTo(lastRow) displays the last row at the top of the viewport
- Open