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

A ListView control's items do not refresh when placed inside a SubScene node.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 8u40
    • 8u20
    • javafx
    • windows 7
      jdk 8 u20

      When using a ListView control inside a SubScene node having many items for the user to scroll the items are not being refreshed. Typically, when using the wheel mouse or scroll thumb on the ListView control.


      To reproduce run the following application code:

      import javafx.application.Application;
      import javafx.collections.FXCollections;
      import javafx.collections.ObservableList;
      import javafx.scene.Scene;
      import javafx.scene.SubScene;
      import javafx.scene.control.ListView;
      import javafx.scene.layout.Pane;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;

      public class ListViewRefreshViewBug extends Application {
          
          @Override
          public void start(Stage primaryStage) {
              StackPane root = new StackPane();
              
              SubScene subscene = new SubScene(root, 400, 500);
              ObservableList list = FXCollections.observableArrayList();
              for(int i=0; i<100; i++) {
                  list.add("hello " + i);
              }
              ListView listView = new ListView(list);
              root.getChildren().add(listView);
              Pane paneAsRoot = new Pane();
              paneAsRoot.getChildren().add(subscene);
              Scene scene = new Scene(paneAsRoot, 500, 550);
              
              primaryStage.setTitle("ListView issue");
              primaryStage.setScene(scene);
              primaryStage.show();
          }

          /**
           * @param args the command line arguments
           */
          public static void main(String[] args) {
              launch(args);
          }
          
      }

            msladecek Martin Sládeček
            cdea Carl Dea
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: