Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8291467

TableView not properly refreshed after scroll to bottom

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Checked on Windows 11 and Ubuntu 22.04

      A DESCRIPTION OF THE PROBLEM :
      Scrolling to the bottom using method scrollTo() on a TableView on version 19-ea+9 leaves table in wrong state - last row is at the bottom of the visible area but other rows are not rendered, so it leaves empty area above.
      It looks OK on version 17.0.2 - table fills whole visible area with the last row at the bottom.
      On versions 18 -> 19-e+9 last row is at the top of the visible area with empty space below, which also looks worse than on version 17.

      On versions 18+ there is also an output on console:
      "javafx.scene.control.skin.VirtualFlow addTrailingCells
      INFO: index exceeds maxCellCount. Check size calculations for class javafx.scene.control.TableRow"


      REGRESSION : Last worked in version 17.0.4

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Code attached


      ---------- BEGIN SOURCE ----------
      public class App extends Application {

          @Override
          public void start(Stage stage) throws Exception {
           List<String> rows = IntStream.rangeClosed(1, 1000).boxed()
           .map(i -> "row-" + i)
           .collect(Collectors.toList());
          
              TableView<String> tableView = new TableView<>();
              TableColumn<String, String> tc = new TableColumn<>("column-1");
              tc.setCellValueFactory(p -> new ReadOnlyStringWrapper(p.getValue()));
      tableView.getColumns().add(tc);
      tableView.setItems(FXCollections.observableArrayList(rows));
              var scene = new Scene(new StackPane(tableView), 200, 200);
              stage.setScene(scene);
              stage.show();
              
              tableView.scrollTo(rows.size()-1);
          }

          public static void main(String[] args) {
              launch();
          }

      }
      ---------- END SOURCE ----------

      FREQUENCY : always


            jvos Johan Vos
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: