<?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: Uitable cell colors	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/uitable-cell-colors/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/uitable-cell-colors?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=uitable-cell-colors</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Wed, 22 May 2024 07:41:03 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.3</generator>
	<item>
		<title>
		By: Gianmarco		</title>
		<link>https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-524275</link>

		<dc:creator><![CDATA[Gianmarco]]></dc:creator>
		<pubDate>Wed, 22 May 2024 07:41:03 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2476#comment-524275</guid>

					<description><![CDATA[Hi Yair,

what about if I would like to set a specific background and font color to the table row header?]]></description>
			<content:encoded><![CDATA[<p>Hi Yair,</p>
<p>what about if I would like to set a specific background and font color to the table row header?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Maurizio		</title>
		<link>https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-508326</link>

		<dc:creator><![CDATA[Maurizio]]></dc:creator>
		<pubDate>Mon, 23 Mar 2020 18:26:02 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2476#comment-508326</guid>

					<description><![CDATA[Hi Yair,

how can I define a callback for a cell/row/column selection? In createTable you can define a data changed callback, but if you simply select a cell, how can you define a callback?

Thanks]]></description>
			<content:encoded><![CDATA[<p>Hi Yair,</p>
<p>how can I define a callback for a cell/row/column selection? In createTable you can define a data changed callback, but if you simply select a cell, how can you define a callback?</p>
<p>Thanks</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Maurizio		</title>
		<link>https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-508319</link>

		<dc:creator><![CDATA[Maurizio]]></dc:creator>
		<pubDate>Fri, 20 Mar 2020 08:00:57 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2476#comment-508319</guid>

					<description><![CDATA[Thank you Yair, I&#039;ve supposed it, but I was not sure.

Maurizio]]></description>
			<content:encoded><![CDATA[<p>Thank you Yair, I&#8217;ve supposed it, but I was not sure.</p>
<p>Maurizio</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-508317</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 19 Mar 2020 17:31:23 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2476#comment-508317</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-508316&quot;&gt;Maurizio&lt;/a&gt;.

headers is a simple cell array of strings (column header names). I thought that was pretty obvious from the context...

Additional types of uitable customizations are described in other articles on this website, and in my book (&quot;&lt;a href=&quot;http://undocumentedmatlab.com/books/matlab-java&quot;&gt;Undocumented Secrets of Matlab-Java Programming&lt;/a&gt;&quot;), and in my &lt;a href=&quot;http://undocumentedmatlab.com/articles/uitable-customization-report&quot;&gt;Uitable Customization Report&lt;/a&gt;. If you&#039;d like personal assistance with your specific project, I&#039;d be happy to help you as a &lt;a href=&quot;http://undocumentedmatlab.com/consulting&quot;&gt;professional consultant&lt;/a&gt;.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-508316">Maurizio</a>.</p>
<p>headers is a simple cell array of strings (column header names). I thought that was pretty obvious from the context&#8230;</p>
<p>Additional types of uitable customizations are described in other articles on this website, and in my book (&#8220;<a href="http://undocumentedmatlab.com/books/matlab-java">Undocumented Secrets of Matlab-Java Programming</a>&#8220;), and in my <a href="http://undocumentedmatlab.com/articles/uitable-customization-report">Uitable Customization Report</a>. If you&#8217;d like personal assistance with your specific project, I&#8217;d be happy to help you as a <a href="http://undocumentedmatlab.com/consulting">professional consultant</a>.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Maurizio		</title>
		<link>https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-508316</link>

		<dc:creator><![CDATA[Maurizio]]></dc:creator>
		<pubDate>Thu, 19 Mar 2020 17:19:58 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2476#comment-508316</guid>

					<description><![CDATA[Hi Yair,

i&#039;m trying to use your code example to change the colors of a table cell, but I have a doubt: in the following part of your code:
&lt;pre lang=&quot;matlab&quot;&gt;
% Yellow background for significant rows based on p-value
if data(rowIdx,12)&lt;=5 &amp;&amp; data(rowIdx,11)~=0
    for colIdx = 1 : length(headers)
      cr.setCellBgColor(rowIdx-1,colIdx-1,java.awt.Color(1,1,0));    % yellow
    end
&lt;/pre&gt;
what is &#034;headers&#034;? It is not defined, so I don&#039;t know what to do when I call 

&lt;pre lang=&quot;matlab&quot;&gt;jTable.setModel(javax.swing.table.DefaultTableModel(dataCells,headers));&lt;/pre&gt;

Is it a cell array containing the columns name? Can you explain?

I don&#039;t know java language, so I have some problem to understand the code, I built a java table using your &#034;createTable.m&#034; code, but there isn&#039;t any example to how to change cell color or font.

Thank you]]></description>
			<content:encoded><![CDATA[<p>Hi Yair,</p>
<p>i&#8217;m trying to use your code example to change the colors of a table cell, but I have a doubt: in the following part of your code:</p>
<pre lang="matlab">
% Yellow background for significant rows based on p-value
if data(rowIdx,12)<=5 &#038;&#038; data(rowIdx,11)~=0
    for colIdx = 1 : length(headers)
      cr.setCellBgColor(rowIdx-1,colIdx-1,java.awt.Color(1,1,0));    % yellow
    end
</pre>
<p>what is &quot;headers&quot;? It is not defined, so I don't know what to do when I call </p>
<pre lang="matlab">jTable.setModel(javax.swing.table.DefaultTableModel(dataCells,headers));</pre>
<p>Is it a cell array containing the columns name? Can you explain?</p>
<p>I don't know java language, so I have some problem to understand the code, I built a java table using your &quot;createTable.m&quot; code, but there isn't any example to how to change cell color or font.</p>
<p>Thank you</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-508108</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sun, 12 Jan 2020 09:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2476#comment-508108</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-508107&quot;&gt;Philip&lt;/a&gt;.

Philip - perhaps you forgot to update the table&#039;s model to a &lt;a href=&quot;http://www.jidesoft.com/javadoc/com/jidesoft/grid/DefaultStyleTableModel.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;DefaultStyleTableModel&lt;/a&gt;. In any case, this topic is way outside the scope of this blog, which is Matlab-centric - It relates to a pure Java component that is covered in the JIDE documentation and forums, so I will not discuss it in any detail here.
If you&#039;d like my additional assistance in your specific case, please contact me by email for a private consulting proposal.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-508107">Philip</a>.</p>
<p>Philip &#8211; perhaps you forgot to update the table&#8217;s model to a <a href="http://www.jidesoft.com/javadoc/com/jidesoft/grid/DefaultStyleTableModel.html" target="_blank" rel="nofollow">DefaultStyleTableModel</a>. In any case, this topic is way outside the scope of this blog, which is Matlab-centric &#8211; It relates to a pure Java component that is covered in the JIDE documentation and forums, so I will not discuss it in any detail here.<br />
If you&#8217;d like my additional assistance in your specific case, please contact me by email for a private consulting proposal.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Philip		</title>
		<link>https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-508107</link>

		<dc:creator><![CDATA[Philip]]></dc:creator>
		<pubDate>Sun, 12 Jan 2020 09:29:41 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2476#comment-508107</guid>

					<description><![CDATA[Yair,

I am a bit of a novice at programming with Java.  Would you please expound a bit more or provide an example on how to use JIDE&#039;s CellStyle in MATLAB?  I have successfully created a CellStyle object and set its properties in MATLAB.  I used your uiinspect tool to verify that the object was created and props were set appropriately but have been unable to assign the object to specific cells.  Methods like setCellStyle(int, int, com.jidesoft.grid.CellStyle) do not appear to be valid.  I have read through the JIDE Grids Developer Guide but have not found it to be very helpful for my purpose.  I have also read through your Uitable Customization Report but it does not provide any detail on the use of CellStyle.

Philip]]></description>
			<content:encoded><![CDATA[<p>Yair,</p>
<p>I am a bit of a novice at programming with Java.  Would you please expound a bit more or provide an example on how to use JIDE&#8217;s CellStyle in MATLAB?  I have successfully created a CellStyle object and set its properties in MATLAB.  I used your uiinspect tool to verify that the object was created and props were set appropriately but have been unable to assign the object to specific cells.  Methods like setCellStyle(int, int, com.jidesoft.grid.CellStyle) do not appear to be valid.  I have read through the JIDE Grids Developer Guide but have not found it to be very helpful for my purpose.  I have also read through your Uitable Customization Report but it does not provide any detail on the use of CellStyle.</p>
<p>Philip</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-508094</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 07 Jan 2020 22:25:06 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2476#comment-508094</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-508093&quot;&gt;Philip&lt;/a&gt;.

@Philip - in the Java-based uitable you can use &lt;a href=&quot;http://www.jidesoft.com/javadoc/com/jidesoft/grid/CellStyle.html&quot; rel=&quot;nofollow&quot;&gt;JIDE&#039;s CellStyle&lt;/a&gt; to customize specific cells. Refer to JIDE&#039;s documentation for details.
In the web-based (uifigure/AppDesigner) uitable, you can use the &lt;b&gt;&lt;i&gt;&lt;a href=&quot;https://www.mathworks.com/help/matlab/ref/uistyle.html&quot; rel=&quot;nofollow&quot;&gt;uistyle&lt;/a&gt;&lt;/i&gt;&lt;/b&gt; function starting in R2019b.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-508093">Philip</a>.</p>
<p>@Philip &#8211; in the Java-based uitable you can use <a href="http://www.jidesoft.com/javadoc/com/jidesoft/grid/CellStyle.html" rel="nofollow">JIDE&#8217;s CellStyle</a> to customize specific cells. Refer to JIDE&#8217;s documentation for details.<br />
In the web-based (uifigure/AppDesigner) uitable, you can use the <b><i><a href="https://www.mathworks.com/help/matlab/ref/uistyle.html" rel="nofollow">uistyle</a></i></b> function starting in R2019b.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Philip		</title>
		<link>https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-508093</link>

		<dc:creator><![CDATA[Philip]]></dc:creator>
		<pubDate>Tue, 07 Jan 2020 21:43:35 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2476#comment-508093</guid>

					<description><![CDATA[Yair,

You may have addressed this already in the past, if so, please kindly point me to the appropriate article(s).  My issue is with creating a table which has (not column but) cell specific renderers, editors, and editability.  Therefore cells within the same column use different renderers, editors, and may or may not be editable.  What adds further complexity is that I have a table who&#039;s rows may or may not span multiple columns.  I can upload / email my code if this helps.

Philip]]></description>
			<content:encoded><![CDATA[<p>Yair,</p>
<p>You may have addressed this already in the past, if so, please kindly point me to the appropriate article(s).  My issue is with creating a table which has (not column but) cell specific renderers, editors, and editability.  Therefore cells within the same column use different renderers, editors, and may or may not be editable.  What adds further complexity is that I have a table who&#8217;s rows may or may not span multiple columns.  I can upload / email my code if this helps.</p>
<p>Philip</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: EHSAN		</title>
		<link>https://undocumentedmatlab.com/articles/uitable-cell-colors#comment-463033</link>

		<dc:creator><![CDATA[EHSAN]]></dc:creator>
		<pubDate>Tue, 19 Feb 2019 08:48:14 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2476#comment-463033</guid>

					<description><![CDATA[in the name of god 
DEAR Yair
I&#039;m having a project with a graphical user interface environment with a MacAccess user and I&#039;ve encountered a problem. I want to be in the graphical user interface table with MATLAB software user,Multi-row cells are combined, subtracted, divided and minus and placed in another cell in the same table. This question is very important to me. Please email us.  

thank you. ]]></description>
			<content:encoded><![CDATA[<p>in the name of god<br />
DEAR Yair<br />
I&#8217;m having a project with a graphical user interface environment with a MacAccess user and I&#8217;ve encountered a problem. I want to be in the graphical user interface table with MATLAB software user,Multi-row cells are combined, subtracted, divided and minus and placed in another cell in the same table. This question is very important to me. Please email us.  </p>
<p>thank you. </p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
