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

TreeTableView: incorrect scrolling range

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: javafx
    • Labels:
    • Environment:

      b129, Win7

      Description

      TreeTableView's scrolling range is calculated incorrectly. To reproduce expand the root for the sample below.

      import javafx.application.Application;
      import javafx.beans.property.ReadOnlyStringWrapper;
      import javafx.beans.value.ObservableValue;
      import javafx.scene.Scene;
      import javafx.scene.control.TreeItem;
      import javafx.scene.control.TreeTableColumn;
      import javafx.scene.control.TreeTableView;
      import javafx.stage.Stage;
      import javafx.util.Callback;

      public class App extends Application {

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

          @Override
          public void start(Stage stage) throws Exception {
              TreeTableView<String> control = new TreeTableView<String>();
              TreeTableColumn<String, String> column = new TreeTableColumn<String, String>("Column 0");
              control.getColumns().add(column);
              column.setCellValueFactory(new Callback<TreeTableColumn.CellDataFeatures<String, String>, ObservableValue<String>>() {
                  @Override
                  public ObservableValue<String> call(TreeTableColumn.CellDataFeatures<String, String> p) {
                      return new ReadOnlyStringWrapper(p.getValue().getValue());
                  }
              });
              TreeItem<String> root = new TreeItem<String>("Root");
              control.setRoot(root);
              for (int i = 0; i < 20; i++) {
                  TreeItem<String> item = new TreeItem<String>("Item " + i);
                  root.getChildren().add(item);
              }
              stage.setScene(new Scene(control));
              stage.show();
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              jgiles Jonathan Giles
              Reporter:
              ogb Oleg Barbashov (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: