I am trying to create a table in MATLAB where I can programmatically change the scroll position. I created a uitable and retrieved the Java object handle UITablePeer (designated here as htable ).
Then I got a handle to the UIScrollbarPane object using:
hscroll = htable.getParent.getParent.getVerticalScrollBar
At this point, the figure looks like this (my actual table is more complicated, this is exactly what I did as an example):

The box in the lower left corner of the table is pushbutton . When his callback starts, he uses the setValue method to change the location of the scroll bar, for example.
hscroll.setValue(10)
After that, the table looks like this:

As you can see, the top of the table is damaged. I tried using the refresh or repaint , but they don't seem to help; the only way to fix it is to move another window (by dragging or Alt-Tabbing) so that the table is completely closed, and when I go back to the table, thatβs OK. Obviously, this is not an optimal solution.
Can someone suggest a way to prevent or fix this?
thanks
user1952425
source share