From: wma on
Hello,

is there a possibility to hide (disable) a jlabel which is created like this:

global output
global jLabel
global hcomponent
global hcontainer
output = '<html><p>test</p></html>';
jLabel = javaObjectEDT('javax.swing.JLabel',output);
[hcomponent,hcontainer] = javacomponent(jLabel,[10,10,610,420],gcf);

i already tried

jLabel.list but i cannot find anything.

I have several menuitems where i have to switch the text inside the label.
I need rich-text functions so i have to use something like jlabel right?

Does anyone can paste code for jtextea ?
From: Yair Altman on
"wma " <wma(a)wma.test> wrote in message <hkop3d$19a$1(a)fred.mathworks.com>...
> Hello,
>
> is there a possibility to hide (disable) a jlabel which is created like this:
>
> global output
> global jLabel
> global hcomponent
> global hcontainer
> output = '<html><p>test</p></html>';
> jLabel = javaObjectEDT('javax.swing.JLabel',output);
> [hcomponent,hcontainer] = javacomponent(jLabel,[10,10,610,420],gcf);
>
> i already tried
>
> jLabel.list but i cannot find anything.
>
> I have several menuitems where i have to switch the text inside the label.
> I need rich-text functions so i have to use something like jlabel right?
>
> Does anyone can paste code for jtextea ?

1. Use the UIInspect utility to understand which methods and properties are available on your object: http://www.mathworks.com/matlabcentral/fileexchange/17935-uiinspect-display-methodspropertiescallbacks-of-an-object . In your specific case, there are separate properties (and accessor methods) for hiding/showing and for enabling/disabling.
2. Dynamic menu items were explained here: http://undocumentedmatlab.com/blog/setting-listbox-mouse-actions/
3. Rich-text in Matlab text-areas (editboxes) was explained here: http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/

Yair Altman
http://UndocumentedMatlab.com
From: wma on
> 1. Use the UIInspect utility to understand which methods and properties are available on your object: http://www.mathworks.com/matlabcentral/fileexchange/17935-uiinspect-display-methodspropertiescallbacks-of-an-object . In your specific case, there are separate properties (and accessor methods) for hiding/showing and for enabling/disabling.
> 2. Dynamic menu items were explained here: http://undocumentedmatlab.com/blog/setting-listbox-mouse-actions/
> 3. Rich-text in Matlab text-areas (editboxes) was explained here: http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/
>
> Yair Altman
> http://UndocumentedMatlab.com

Thank you for your answer. thank you for this very interesting tool

Im still stuck here:

I created an object like this:
introtext=uicomponent('style','JLabel','Text',output,'Position'
[10,10,610,420],'Tag','introtext');

at a later point i want to delete or "unvisible" it, how do i manage to delet this object?

set(handles.introtext,'Visible','off') does not work.
From: Yair Altman on
"wma " <wma(a)wma.test> wrote in message <hksbe1$5d2$1(a)fred.mathworks.com>...
> > 1. Use the UIInspect utility to understand which methods and properties are available on your object: http://www.mathworks.com/matlabcentral/fileexchange/17935-uiinspect-display-methodspropertiescallbacks-of-an-object . In your specific case, there are separate properties (and accessor methods) for hiding/showing and for enabling/disabling.
> > 2. Dynamic menu items were explained here: http://undocumentedmatlab.com/blog/setting-listbox-mouse-actions/
> > 3. Rich-text in Matlab text-areas (editboxes) was explained here: http://undocumentedmatlab.com/blog/rich-matlab-editbox-contents/
> >
> > Yair Altman
> > http://UndocumentedMatlab.com
>
> Thank you for your answer. thank you for this very interesting tool
>
> I'm still stuck here:
>
> I created an object like this:
> introtext=uicomponent('style','JLabel','Text',output,'Position',[10,610,420],'Tag','introtext');
>
> at a later point i want to delete or "unvisible" it, how do i manage to delete this object?
>
> set(handles.introtext,'Visible','off') does not work.

set(introtext,'visible','off') works for me. In your case, handles.introtext may be an empty or invalid handle - set a breakpoint and check.

To completely delete the label, simply do delete(introtext), just like for any other Matlab control. As before, you need a valid handle or else it will not work.

Yair Altman
http://UndocumentedMatlab.com