I would like to place the cursor (or even better highlight the text) in an Edit text box in a Matlab GUI when the application starts, is there any simple way of doing this?
Thanks in advance!
I would like to place the cursor (or even better highlight the text) in an Edit text box in a Matlab GUI when the application starts, is there any simple way of doing this?
Thanks in advance!
You'll need this tool from Yair Altman http://www.mathworks.co.uk/matlabcentral/fileexchange/14317-findjobj-find-java-handles-of-matlab-graphic-objects
and than just type following:
jEdit = findjobj(HandleOfYourEditBox);
jEdit.Caret.setDot(0)
To highlight text use following:
jEdit.selectAll % to highlight everything
jEdit.setSelectionStart(3) % start Index
jEdit.setSelectionEnd(4) % end Index