Is there a way I can set the scroll position for the table such that I can prevent the view "jumping" every time the table is updated?
I understand nothing of the sort is currently supported by matlab, but does anyone know how I can achieve this given access to the underlying java swing object? I have already achieved, in other respects, the functionality I desire from the uitable using the findjobj function from the file exchange.
There are two solutions. Note that both of them are unsupported and undocumented. Both solutions require the FINDJOBJ utility ( http://www.mathworks.com/matlabcentral/fileexchange/14317-findjobj-find-java-handles-of-matlab-graphic-objects ) to access the uitable's underlying Java table object reference handle:
1. Rather than updating the entire data, update only a particular table cell, as explained for example here: http://www.mathworks.com/matlabcentral/newsreader/view_thread/308624 (there are several other examples if you search the newsgroup for "uitable" and "findjobj" and/or "setValueAt"
2. Control the scrollbars, as explained here:
http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/
http://undocumentedmatlab.com/blog/customizing-listbox-editbox-scrollbars/
Yair Altman
http://UndocumentedMatlab.com
Thanks very much for your response. I think your second suggestion would work best for my situation, but I don't can't see how to apply it to my problem. Though the EditBox article changes the line position, it does this with the setCaretPosition method. I don't quite see how this could work with the uitable, and the other article dealt with the Scrollbar policies and line-wrapping, but didn't mention any way to get or set the current scroll position.
Is there a way once I've got the Java scroll-pane container reference that I can
1) Get the current line position corresponding to the top visible row
2) Set the scroll position to match that in (1)
Thanks,
Andy
"Yair Altman" wrote in message <isgsoc$fof$1...@newscl01ah.mathworks.com>...