<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: HTML support in Matlab uicomponents	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=html-support-in-matlab-uicomponents</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Wed, 11 Sep 2024 12:14:38 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>
		By: Nina797		</title>
		<link>https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-525260</link>

		<dc:creator><![CDATA[Nina797]]></dc:creator>
		<pubDate>Wed, 11 Sep 2024 12:14:38 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=14#comment-525260</guid>

					<description><![CDATA[Hey Yair,
I really appreciate your fantastic blog! I had no idea these amazing features were out there, and many of them are exactly what I’ve been looking for.
Thanks again!]]></description>
			<content:encoded><![CDATA[<p>Hey Yair,<br />
I really appreciate your fantastic blog! I had no idea these amazing features were out there, and many of them are exactly what I’ve been looking for.<br />
Thanks again!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Martin Lechner		</title>
		<link>https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-507214</link>

		<dc:creator><![CDATA[Martin Lechner]]></dc:creator>
		<pubDate>Wed, 06 Nov 2019 04:26:35 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=14#comment-507214</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-506283&quot;&gt;K Xu&lt;/a&gt;.

For html strings you have to replace the special characters with the entity names (e.g. replace 
&lt;pre&gt;&#039;&#060;&#039; by &#039;&#038;lt;&#039; or 
&#039;&#062;&#039; by &#039;&#038;gt;&#039;&lt;/pre&gt;).
For a description to entity names and a list of the important ones see &lt;a href=&quot;https://www.w3schools.com/html/html_entities.asp&quot; rel=&quot;nofollow&quot;&gt;https://www.w3schools.com/html/html_entities.asp&lt;/a&gt;
A full list character entity names can be seen in &lt;a href=&quot;https://dev.w3.org/html5/html-author/charref&quot; rel=&quot;nofollow&quot;&gt;https://dev.w3.org/html5/html-author/charref&lt;/a&gt;.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-506283">K Xu</a>.</p>
<p>For html strings you have to replace the special characters with the entity names (e.g. replace </p>
<pre>'&lt;' by '&amp;lt;' or 
'&gt;' by '&amp;gt;'</pre>
<p>).<br />
For a description to entity names and a list of the important ones see <a href="https://www.w3schools.com/html/html_entities.asp" rel="nofollow">https://www.w3schools.com/html/html_entities.asp</a><br />
A full list character entity names can be seen in <a href="https://dev.w3.org/html5/html-author/charref" rel="nofollow">https://dev.w3.org/html5/html-author/charref</a>.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: K Xu		</title>
		<link>https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-506283</link>

		<dc:creator><![CDATA[K Xu]]></dc:creator>
		<pubDate>Thu, 31 Oct 2019 16:03:55 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=14#comment-506283</guid>

					<description><![CDATA[Trouble is, when there are &quot;&#060;&#034; in the string, they are not shown in Matlab! Any ideas to fix it?]]></description>
			<content:encoded><![CDATA[<p>Trouble is, when there are &#8220;&lt;&quot; in the string, they are not shown in Matlab! Any ideas to fix it?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Chaithya G R		</title>
		<link>https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-413744</link>

		<dc:creator><![CDATA[Chaithya G R]]></dc:creator>
		<pubDate>Mon, 18 Sep 2017 09:43:46 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=14#comment-413744</guid>

					<description><![CDATA[Hey Yair,
Thanks for such an awesome blog... I never knew such great capabilities existed, most of which i really needed...
Thanks again..]]></description>
			<content:encoded><![CDATA[<p>Hey Yair,<br />
Thanks for such an awesome blog&#8230; I never knew such great capabilities existed, most of which i really needed&#8230;<br />
Thanks again..</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-403736</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sun, 26 Mar 2017 18:38:37 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=14#comment-403736</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-403579&quot;&gt;darsh&lt;/a&gt;.

@darsh - yes it is possible using &lt;code&gt;&#060;div&#062;&lt;/code&gt; or &lt;code&gt;&#060;tr&#062;/&#060;td&#062;&lt;/code&gt;, but this has some drawbacks:
&lt;pre lang=&quot;matlab&quot;&gt;hButton.String = &#039;&lt;html&gt;&lt;tr&gt;&lt;td width=9999 align=left&gt;Left-aligned&#039;&lt;/pre&gt;

Instead, I suggest using the text alignment methods/properties of the underlying Java control: &lt;a href=&quot;http://undocumentedmatlab.com/blog/button-customization&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://undocumentedmatlab.com/blog/button-customization&lt;/a&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-403579">darsh</a>.</p>
<p>@darsh &#8211; yes it is possible using <code>&lt;div&gt;</code> or <code>&lt;tr&gt;/&lt;td&gt;</code>, but this has some drawbacks:</p>
<pre lang="matlab">hButton.String = '<html><tr><td width=9999 align=left>Left-aligned'</td></tr></html></pre>
<p>Instead, I suggest using the text alignment methods/properties of the underlying Java control: <a href="http://undocumentedmatlab.com/blog/button-customization" target="_blank" rel="nofollow">http://undocumentedmatlab.com/blog/button-customization</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: darsh		</title>
		<link>https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-403579</link>

		<dc:creator><![CDATA[darsh]]></dc:creator>
		<pubDate>Fri, 24 Mar 2017 01:19:08 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=14#comment-403579</guid>

					<description><![CDATA[while using html in Matlab uitable cell to change color , can I at the same time also specify alignment to centre or left? I don&#039;t know html and am trying to work out if this is possible or not
data(1,1)=&#039;&#060;html&#062;&#060;font bgcolor=#FF8800&#062;1&#060;/font&#062;&#060;/html&#062;&#039;]]></description>
			<content:encoded><![CDATA[<p>while using html in Matlab uitable cell to change color , can I at the same time also specify alignment to centre or left? I don&#8217;t know html and am trying to work out if this is possible or not<br />
data(1,1)='&lt;html&gt;&lt;font bgcolor=#FF8800&gt;1&lt;/font&gt;&lt;/html&gt;&#8217;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-386971</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 30 Aug 2016 13:37:58 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=14#comment-386971</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-386958&quot;&gt;Meade&lt;/a&gt;.

@Meade - it&#039;s not Matlab that ignores the align directive but rather the underlying Java Swing behavior, which snugly fits the text in the center of the button, and of course aligning text within a tight-fitting box has no effect. The workaround I suggested simply forces Swing to use a non-tightly-fitting boundary box, within which you can indeed align the text. It&#039;s a pretty standard HTML/CSS behavior workaround, and any decent web developer could probably find several similar alternatives.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-386958">Meade</a>.</p>
<p>@Meade &#8211; it&#8217;s not Matlab that ignores the align directive but rather the underlying Java Swing behavior, which snugly fits the text in the center of the button, and of course aligning text within a tight-fitting box has no effect. The workaround I suggested simply forces Swing to use a non-tightly-fitting boundary box, within which you can indeed align the text. It&#8217;s a pretty standard HTML/CSS behavior workaround, and any decent web developer could probably find several similar alternatives.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Meade		</title>
		<link>https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-386958</link>

		<dc:creator><![CDATA[Meade]]></dc:creator>
		<pubDate>Tue, 30 Aug 2016 11:20:28 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=14#comment-386958</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-386403&quot;&gt;Yair Altman&lt;/a&gt;.

@Yair

This is a great work-around!
I&#039;m guessing by your suggestion that Matlab doesn&#039;t interpret any of the &#039;align&#039; commands for text in naked Matlab uibuttons?
As for suggestion two, I&#039;m very familiar with your great &#124;findjobj&#124; utility.  I use it all the time.  I was hoping to avoid jButtons if possible, but they might be best choice afterall.
Many thanks!
meade]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-386403">Yair Altman</a>.</p>
<p>@Yair</p>
<p>This is a great work-around!<br />
I&#8217;m guessing by your suggestion that Matlab doesn&#8217;t interpret any of the &#8216;align&#8217; commands for text in naked Matlab uibuttons?<br />
As for suggestion two, I&#8217;m very familiar with your great |findjobj| utility.  I use it all the time.  I was hoping to avoid jButtons if possible, but they might be best choice afterall.<br />
Many thanks!<br />
meade</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-386403</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 23 Aug 2016 17:05:46 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=14#comment-386403</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-386047&quot;&gt;Meade&lt;/a&gt;.

@Meade - You can use an HTML string such as this:
&lt;pre lang=&quot;matlab&quot;&gt;
pxPos = getpixelposition(hButton);
hButton.String = [&#039;&lt;html&gt;&lt;div width=&quot;&#039; num2str(pxPos(3)-20) &#039;px&quot; align=&quot;right&quot;&gt;text&#039;];  % button margins use 20px
&lt;/pre&gt;

A better solution is to use the &lt;a href=&quot;http://undocumentedmatlab.com/blog/findjobj-find-underlying-java-object/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;i&gt;&lt;b&gt;findjobj&lt;/b&gt;&lt;/i&gt; utility&lt;/a&gt; as explained &lt;a href=&quot;http://undocumentedmatlab.com/blog/button-customization&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;. This would be independent of the button&#039;s pixel-size and would work even when the button is resized.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-386047">Meade</a>.</p>
<p>@Meade &#8211; You can use an HTML string such as this:</p>
<pre lang="matlab">
pxPos = getpixelposition(hButton);
hButton.String = ['<html><div width="' num2str(pxPos(3)-20) 'px" align="right">text'];  % button margins use 20px
</div></html></pre>
<p>A better solution is to use the <a href="http://undocumentedmatlab.com/blog/findjobj-find-underlying-java-object/" target="_blank" rel="nofollow"><i><b>findjobj</b></i> utility</a> as explained <a href="http://undocumentedmatlab.com/blog/button-customization" target="_blank" rel="nofollow">here</a>. This would be independent of the button&#8217;s pixel-size and would work even when the button is resized.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Meade		</title>
		<link>https://undocumentedmatlab.com/articles/html-support-in-matlab-uicomponents#comment-386047</link>

		<dc:creator><![CDATA[Meade]]></dc:creator>
		<pubDate>Fri, 19 Aug 2016 15:57:27 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=14#comment-386047</guid>

					<description><![CDATA[Is it possible to change the horizontal &#038; vertical alignment of the pushbutton string with CSS  tags?
I see that most directives work, but I don&#039;t see any effect from:

&lt;pre lang=&quot;matlab&quot;&gt;hButton.String = &#039;&lt;html&gt;&lt;div style=&quot;text-align:right&quot;&gt;My RIGHT ALIGNED string&#039;;&lt;/pre&gt;

Much thanks for all you do!]]></description>
			<content:encoded><![CDATA[<p>Is it possible to change the horizontal &amp; vertical alignment of the pushbutton string with CSS  tags?<br />
I see that most directives work, but I don&#8217;t see any effect from:</p>
<pre lang="matlab">hButton.String = '<html><div style="text-align:right">My RIGHT ALIGNED string';</div></html></pre>
<p>Much thanks for all you do!</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
