I needed to keep two ListViews scrolling in sync, so searching the internet I found this: http://stackoverflow.com/questions/16937470/listen-to-scrollbar-change-in-listview
which I have ported to B4j, and added a few extra tweaks. There is a bit of JavaObject jiggery pokery like using a Java Iterator, and setting up a value change listener.
It also syncs the selection of the items between the two lists.
The example syncs the Vertical scroll bar, it is also possible to sync the Horizontal scroll bar or both.
I thought I'd share as it may be useful to someone.
Requires JavaObject.
which I have ported to B4j, and added a few extra tweaks. There is a bit of JavaObject jiggery pokery like using a Java Iterator, and setting up a value change listener.
It also syncs the selection of the items between the two lists.
The example syncs the Vertical scroll bar, it is also possible to sync the Horizontal scroll bar or both.
I thought I'd share as it may be useful to someone.
Requires JavaObject.
Attachments
Last edited: