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

Flickering empty rows while updating a cell in a ListView

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 8u20
    • 8u20
    • javafx
    • Linux and Windows, Java 8u20 b05

    Description

      When I update a single cell in a ListView fairly rapidly (following a mouse movement or drag) some or all of the empty cells will flicker quite noticeably to all grey.

      Run the provided test class and move the mouse left or right over the list. This will update the first cell with the mouse x location. Notice that if you keep moving the mouse some of the empty cells will turn all grey.

      Also note that if you resize the window and then move the mouse again you might observe that a different number of empty cells will block out grey.

      ************************************** Test Class ***************************************************
      import javafx.application.Application;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.control.ListView;
      import javafx.scene.input.MouseEvent;
      import javafx.scene.layout.StackPane;
      import javafx.stage.Stage;

      public class ListViewTest extends Application {

         @Override
         public void start(final Stage primaryStage) throws Exception {

            final ListView<Double> list = new ListView<>();
            list.getItems().addAll(0d, 333d, 666d);
            
            list.setOnMouseMoved(new EventHandler<MouseEvent>() {
               @Override public void handle(MouseEvent event) {
                  list.getItems().set(0, event.getSceneX());
               }
            });
            
            primaryStage.centerOnScreen();
            primaryStage.setHeight(350);
            primaryStage.setWidth(500);
            
            primaryStage.setScene(new Scene(new StackPane(list)));

            primaryStage.show();

         }

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

      }

      Attachments

        Issue Links

          Activity

            People

              jgiles Jonathan Giles
              csmithjfx Charles Smith (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: