Change single value in uitable

조회 수: 3 (최근 30일)
Martijn Steenwijk
Martijn Steenwijk 2011년 9월 19일
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에서 Mathematics and Optimization에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by