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);
}
}
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);
}
}
- relates to
-
JDK-8093914 Array out of bounds in VirtualFlow.
- Resolved
-
JDK-8094776 [VirtualFlow] NPE in VirtualFlow.layoutChildren with filtered list view.
- Resolved
-
JDK-8094776 [VirtualFlow] NPE in VirtualFlow.layoutChildren with filtered list view.
- Resolved