Change single value in uitable

5 次查看(过去 30 天)
Dear all,
I'm using an uitable to list my data. If I programmatically change one of the data values, the viewport resets the scrolling and goes back to to the 'initial view' (i.e. first row, first column in the left top).
Is it possible to edit a single value in an uitable, but not change the viewport?
Best, Martijn
  2 个评论
Jan
Jan 2011-9-19
Please send this question to the technical support also. The implementation of UITABLE and UITREE is still very poor, although such controls could be very useful. Using old fashioned Matlab GUIs looks very dull, while the operating systems are driving mad by transparent figure borders, 3D animations and gadgets on the desktop.
Martijn Steenwijk
Martijn Steenwijk 2011-9-20
I will do. But maybe somebody has a smart idea?

请先登录,再进行评论。

采纳的回答

Jan
Jan 2011-9-20
Have you seen this Java methods: Undocumented: JScrollPane of uicontrols ?
  1 个评论
Martijn Steenwijk
Martijn Steenwijk 2011-9-20
Based on your first reply I just figured out the same solution. Thanks a lot. The way to go is:
t = uitable;
set(t,'Data',data);
jscroll = findjobj(t);
jtable = jscroll.getViewport.getComponent(0);
jtable.setValueAt(java.lang.String('This value will be inserted'),0,0); % to insert this value in cell (1,1)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by