문제

I've bind a ListView to a SynchronizedObservableList. Can I modify the list (add, remove, etc.) out of the UI Thread? There would be no exception but get the UI correctly synchronized?

도움이 되었습니까?

해결책

No: if the observable list is being used for the data for the ListView (or the data for the ListView is are bound to it), then it should only be modified on the FX Application Thread.

While using a synchronized list offers some synchronization guarantees on the list data, since you have bound the ListView to it, modifying the synchronizedObservableList will cause changes in the ListView's properties (for example, it will cause changes to its cells). There are no synchronization guarantees on the properties of the ListView itself and any changes to those properties need to occur on the FX Application Thread.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top