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

TreeTableView: incorrect scrolling range

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • javafx
    • b129, Win7

      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();
          }
      }

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

              Created:
              Updated:
              Resolved: