Hello, I have the following problem. I am appending new empty rows to a table in my GUI with this code:
oldData = get(handles.DataTable,'Data');
nRows = size(oldData,1);
data = cell(nRows+newRow,3);
data(1:nRows,:) = oldData;
jScrollpane = findjobj(handles.DataTable);
scrollMax = jScrollpane.getVerticalScrollBar.getMaximum;
And here is the funny thing! If I run this code in debug mode, step-by-step, my problems are solved, new rows are added and the scroll stays where it should (or actually jumps to the end after the GUI element is updated). But when I run the code normally, without debugging, the scroll jumps back to the zero position, as if setValue(scrollMax) wouldn't be there.
Any idea what is happening?