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

ListView vertical scrolling issue

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: fx2.0
    • Fix Version/s: fx2.0
    • Component/s: javafx
    • Environment:

      Product: javafx-2.0beta
      Platform: macosx-universal
      Build-Number: 238
      Build-ID: 2011-08-15_21-49-05

      Description

      I have a ListView for wich the prefH and prefW have been set. I am dynamically adding items to the list. When the first item located outside of the visible content is added, the vertical Scrollbar is displayed but it doesn't allow to scroll the content. Adding other items makes the scrollbar to become effective.

      In a more complex containment context for which I don't manage to get a testcase, the ScrollBar becomes effective (allows me to scroll) when I add items twice the visible height.

      Testcase:
              AnchorPane ap = new AnchorPane();
              final ListView list = new ListView();
              list.setPrefSize(100, 75);
              final ObservableList<String> content = FXCollections.observableArrayList();
              list.setItems(content);
              Button b = new Button();

              b.setOnAction(new EventHandler<ActionEvent>() {

                  @Override
                  public void handle(ActionEvent event) {
                      ObservableList<String> newContent = FXCollections.observableArrayList(content);
                      newContent.add("Elem" + i);
                      i += 1;
                      content.setAll(newContent);

                  }
              });
              
              Scene scene = new Scene(ap, 100, 100);
              ap.getChildren().add(list);
              ap.getChildren().add(b);
              primaryStage.setScene(scene);
              primaryStage.setVisible(true);

        Attachments

          Activity

            People

            Assignee:
            jgiles Jonathan Giles
            Reporter:
            jfdenise Jean-Francois Denise (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: