I am trying to solve this problem but i did not reach to the solution.
The problem is that i have a GUI with an edit field, iwould like appear asterisks instead of the text typed by the user.
e.g. (******) instead of (matlab). Please help
Thanks in advance.
http://www.mathworks.com/matlabcentral/fileexchange/24861-35-complete-gui-examples
See question 32.
The problem is that i can not link or deal with those file.
I am using guide while this GUI written directly in m-files.
function passwordDemo
f = figure;
pwd = javax.swing.JPasswordField;
[hComp,hContainer]= javacomponent(pwd,[100,100,200,20],f);
set(hComp,'ActionPerformedCallback',@passwordEntered);
function passwordEntered(varargin)
disp(['The password entered was ', char(hComp.getText)])
end %passwordEntered
end %passwordDemo
Hope this helps
Matt W
"Bader " <hate...@hotmail.com> wrote in message <hhdpvv$m98$1...@fred.mathworks.com>...
I'm not suggesting you link to that file or "deal" with it (I'm not sure what you mean by that). Read GUI_32, specifically the subfunction ed_kpfcn which is set as the key press function for the object S.ed. You would use the same technique if creating a GUI in GUIDE. In the Properties of the editable text box that you're using to hold a password, add a key press function. Then, in the m-file generated by GUIDE, find that key press function and mimic the ed_kpfcn from GUI_32.
i can not dealing with such problems even when mimic an existing code. May u please post the code needed to be added to the key press function and if there is more details mention them. Sorry again and your help is appreciated.
--------------------------------------------------------
If Andy DID post such code for you then you'd be mimicking his
existing code, which goes against your requirements. It will be that
way for any code that you yourself don't write. You have precluded
using any example code. Thus you need to think up your own solution
and not look at any way that anybody else used to solve it. Good luck
with that.
------------------------------------------------------
ImageAnalyst, thanks to advice but what i'm suffering that i am new in Matlab and i don't have enough experience within such those functions. What i have learned is to add gui components and some functions. Thank you again.
OK good. You could learn even more by "mimicing" other people's
code. Look at the GUI tutorials and you'll have several good examples
to learn from:
http://www.mathworks.com/matlabcentral/fileexchange/?term=tag%3A%22gui+example%22
Thank you so much for your interesting,
it is a good source and very helpful.