I create a dedicated message log that uses ListViewto display each message in one cell.

It basically works, but when I scroll very quickly up and down, strange things happen. As you can see, I select the selected cell and the cell where the mouse is. After scrolling up and down, the highlighted cells are not the ones in which my mouse pointer is, and for some cells, I can not select them by clicking.
I was able to reproduce this in a very simple example. Suppose we have ListViewcustom rows MyListCellthat display these cells with TextFlow. The method is updateItem MyListCellas follows:
@Override
protected void updateItem(String item, boolean empty) {
super.updateItem(item, empty);
if (empty || item == null) {
setText(null);
setGraphic(null);
return;
}
TextFlow textFlow = new TextFlow(new Text(item));
setGraphic(textFlow);
setText(null);
}
, factory :
public ObservableList<String > content = FXCollections.observableArrayList();
public ListView<String> listView;
@Override
public void initialize(URL location, ResourceBundle resources) {
listView.setCellFactory(cb -> new MyListCell());
listView.setItems(content);
( ):
: - , ?
- Ubuntu 14.04 Oracle jdk 1.8.0_25