Acess to JAVA handle, Matlab add text to multiline Edit box
2 次查看(过去 30 天)
显示 更早的评论
Hi,
i plan to implement a kind of log-report for my GUI that shows what steps have been done recently.
this code actually implements the editbox with 4 elements, making use of the function 'findjobj' from here
Unfortunately i have no idea how to access this textbox and to add text every time a callback function of my GUI is executed and therefore a report has to be done.
% Begin initialization code - DO NOT EDIT % LOGBOX PROGRAMMATICALLY
str = {'multi','line','editbox', 'test', 'test2'};
hEdit = uicontrol('style','edit','Position',[50 17 851 29],'max',3,'string',str);
% Get the underlying Java control peer (a scroll-pane object)
jhEdit = findjobj(hEdit)
% Check that the scrollpane has a multiline edit control and 2 scrollbars
jhEdit.list
% Get the scroll-pane's internal edit control
jEdit = jhEdit.getComponent(0).getComponent(0)
% Now move the caret position to the end of the text
jEdit.setCaretPosition(jEdit.getDocument.getLength);
HOW CAN I ADD TEXT TO THE TEXTBOX ?
I am very glad for your help!
Best wishes, John
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!