From: Muhammad on
Dear Zhang

How can I make a static text like e text box can be write freely?

Thanks

"Matthew Whitaker" <mattlwhitaker(a)REMOVEgmail.com> wrote in message <hdeoko$ind$1(a)fred.mathworks.com>...
> "Zhang Michael" <cy_xiaoxiao(a)hotmail.com> wrote in message <hdehg4$e2l$1(a)fred.mathworks.com>...
> > Hi.
> >
> > I am designing a matlab GUI. And I add a Static Text Component in the GUI. Now I want to let Static Text show '&#946;'. I know may be I can use latex to make it show '&#946;'. However, when I change the component's String property to \beta, the character '&#946;' doesn't show up.
> > Is there any way to let Static Text Component show math symbols?
> >
> > Thanks
>
> If I have to any non-trivial formatting of the static text I usually use a java JLabel instead and place using java component. This will support HTML text:
> %show the 'for all' and 'beta' symbols
> t = javaObjectEDT('javax.swing.JLabel','<html>&#8704;&#946;</html>'); %note if using earlier than R2008 see awtCreate or create directly (slightly more risky)
> h = figure;
> [hcomponent,hcontainer] = javacomponent(t,[100,100,40,20],h);
>
> A good reference for the HTML symbols can be found at:
> http://www.w3schools.com/tags/ref_symbols.asp
>
> Hope this was helpful
> Matt W
From: Muhammad on
"Matthew Whitaker" <mattlwhitaker(a)REMOVEgmail.com> wrote in message <hdeoko$ind$1(a)fred.mathworks.com>...
> "Zhang Michael" <cy_xiaoxiao(a)hotmail.com> wrote in message <hdehg4$e2l$1(a)fred.mathworks.com>...
> > Hi.
> >
> > I am designing a matlab GUI. And I add a Static Text Component in the GUI. Now I want to let Static Text show '&#946;'. I know may be I can use latex to make it show '&#946;'. However, when I change the component's String property to \beta, the character '&#946;' doesn't show up.
> > Is there any way to let Static Text Component show math symbols?
> >
> > Thanks
>
> If I have to any non-trivial formatting of the static text I usually use a java JLabel instead and place using java component. This will support HTML text:
> %show the 'for all' and 'beta' symbols
> t = javaObjectEDT('javax.swing.JLabel','<html>&#8704;&#946;</html>'); %note if using earlier than R2008 see awtCreate or create directly (slightly more risky)
> h = figure;
> [hcomponent,hcontainer] = javacomponent(t,[100,100,40,20],h);
>
> A good reference for the HTML symbols can be found at:
> http://www.w3schools.com/tags/ref_symbols.asp
>
> Hope this was helpful
> Matt W