Controlling the scroll position of a uitable

Hello
I had a uitable which I decided to split in two, because of its size. Therefore, I want to synchronize the vertial scroll position of both tables, that is, if I scroll down on one table, the other should scroll down by the same amount.
Breaking it down, what I need to do is (for each table): 1) Trigger a callback when the vertical scroll position is changed. 2) Read the current scroll position 3) Set the scroll posiiton of the second table.
However, I can't figure out how to do this, either through native MAtlab or through the Java handle.

Answers (2)

Unfortunately this is not possible, unless it can be done through Java.
The closest you can get to this is to place an object on its own uipanel(); then by changing the Position of the object you can move it around relative to the frame that is the uipanel border. By using linkprop() you can make the Position of the two uitable (each in their own uipanel) the same. You can add a scrollbar outside of either of the two uipanel that you can use to choose the Position.
This is certainly not as nice as using the scrollbars that uipanel automatically provides, but unfortunately there is no documented way to find out what part of the uipanel is currently visible when you use the built-in scrolling.
I'm trying to find a way to do it by Java, but I can't figure out how.
What I actually need is just the ability to get and set the scroll posiiton; it occured to me that rather then triggering a specific callback when the scrollbar is clocked, I can just set table B's scrollbar to table A's scrollbar's setting whenever table A is clicked.

Categories

Find more on Construct and Work with Object Arrays in Help Center and File Exchange

Tags

Asked:

on 21 Dec 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!