<?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: Customizing uicontrol border	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/customizing-uicontrol-border/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/customizing-uicontrol-border?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=customizing-uicontrol-border</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Sun, 28 Feb 2021 06:37:51 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>
		By: Patrick Fitzgerald		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-510026</link>

		<dc:creator><![CDATA[Patrick Fitzgerald]]></dc:creator>
		<pubDate>Sun, 28 Feb 2021 06:37:51 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1947#comment-510026</guid>

					<description><![CDATA[Just a heads up to anyone else digging around for help related to this: if you assign &lt;b&gt;BackrgoundColor&lt;/b&gt; to a pushbutton-style uicontrol, it seems to prevent you from changing the borders. Set the color with &lt;b&gt;CData&lt;/b&gt; manually.]]></description>
			<content:encoded><![CDATA[<p>Just a heads up to anyone else digging around for help related to this: if you assign <b>BackrgoundColor</b> to a pushbutton-style uicontrol, it seems to prevent you from changing the borders. Set the color with <b>CData</b> manually.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348772</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sun, 03 May 2015 06:46:36 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1947#comment-348772</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348764&quot;&gt;liu&lt;/a&gt;.

As I said, If you wish me to spend some time to investigate this, contact me by email for a private consulting.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348764">liu</a>.</p>
<p>As I said, If you wish me to spend some time to investigate this, contact me by email for a private consulting.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: liu		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348764</link>

		<dc:creator><![CDATA[liu]]></dc:creator>
		<pubDate>Sun, 03 May 2015 01:10:16 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1947#comment-348764</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348762&quot;&gt;Yair Altman&lt;/a&gt;.

What happens is that depending on button presses editboxes are dynamically created, customized, removed all the time.
 
Essentially, I just need to keep new ones at the back of old components. The problem is that new ones always appear on top, and a single &#039;uistack&#039; call removes all previous border changes. 

To cut the long way with codes, could you give a quick tip (or keywords) on:
Is it possible to add new components right to the back with java? Or can we set some java &#039;always on top&#039; property? (similar to TooltipString behavior) 

(Thanks a lot for all your time and prompt response!)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348762">Yair Altman</a>.</p>
<p>What happens is that depending on button presses editboxes are dynamically created, customized, removed all the time.</p>
<p>Essentially, I just need to keep new ones at the back of old components. The problem is that new ones always appear on top, and a single &#8216;uistack&#8217; call removes all previous border changes. </p>
<p>To cut the long way with codes, could you give a quick tip (or keywords) on:<br />
Is it possible to add new components right to the back with java? Or can we set some java &#8216;always on top&#8217; property? (similar to TooltipString behavior) </p>
<p>(Thanks a lot for all your time and prompt response!)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348762</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sat, 02 May 2015 23:13:46 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1947#comment-348762</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348761&quot;&gt;liu&lt;/a&gt;.

I do not accept your claim. You can always store the &lt;i&gt;&lt;b&gt;findjobj&lt;/b&gt;&lt;/i&gt;-ed handle in some variable and then use it immediately after &lt;i&gt;&lt;b&gt;uistack&lt;/b&gt;&lt;/i&gt; to reset the border.
I don&#039;t know what the specific problem with the z-order is. 
If you wish me to spend some time to investigate this, contact me by email for a private consulting.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348761">liu</a>.</p>
<p>I do not accept your claim. You can always store the <i><b>findjobj</b></i>-ed handle in some variable and then use it immediately after <i><b>uistack</b></i> to reset the border.<br />
I don&#8217;t know what the specific problem with the z-order is.<br />
If you wish me to spend some time to investigate this, contact me by email for a private consulting.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: liu		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348761</link>

		<dc:creator><![CDATA[liu]]></dc:creator>
		<pubDate>Sat, 02 May 2015 23:08:15 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1947#comment-348761</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348760&quot;&gt;Yair Altman&lt;/a&gt;.

;) Unfortunately, it is impossible in the actual code, where I need this. I&#039;ve shown a very simplified demo-script. The actual code does not allow to  permute those operations. Is there a way to fix &#039;z-Order&#039; solution in the previous code? Thank you!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348760">Yair Altman</a>.</p>
<p>😉 Unfortunately, it is impossible in the actual code, where I need this. I&#8217;ve shown a very simplified demo-script. The actual code does not allow to  permute those operations. Is there a way to fix &#8216;z-Order&#8217; solution in the previous code? Thank you!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348760</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sat, 02 May 2015 22:46:36 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1947#comment-348760</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348759&quot;&gt;liu&lt;/a&gt;.

@Liu - why not simply move the &lt;i&gt;&lt;b&gt;uistack&lt;/b&gt;&lt;/i&gt; command before &lt;i&gt;&lt;b&gt;findjobj&lt;/b&gt;&lt;/i&gt;, then modify the border?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348759">liu</a>.</p>
<p>@Liu &#8211; why not simply move the <i><b>uistack</b></i> command before <i><b>findjobj</b></i>, then modify the border?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: liu		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-348759</link>

		<dc:creator><![CDATA[liu]]></dc:creator>
		<pubDate>Sat, 02 May 2015 22:43:53 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1947#comment-348759</guid>

					<description><![CDATA[Hello. I noticed that &#039;uistack&#039; call cancels border changes made with the suggested java method. &lt;b&gt;Is there a way to change stack order but still keep customized border? &lt;/b&gt;
I&#039;m trying &#039;findjobj&#039; &#038; &#039;setComponentZOrder&#039; combination. The latter works well, but when I attempt to close the figure I get &#039;NullPointerException&#039; error. See the code below. (Thanks a lot!!)

&lt;pre lang=&quot;matlab&quot;&gt;

% --- Figure with listbox and editbox
f = figure; 
hList = uicontrol(f,&#039;style&#039;,&#039;listbox&#039;,&#039;position&#039;,[10 10 400 20]);  
hEdit = uicontrol(f,&#039;style&#039;,&#039;edit&#039;,&#039;position&#039;,[10 10 200 50]); 

% --- Change border of the editbox
jEdit = findjobj(hEdit);
jEdit.Border = javax.swing.border.LineBorder(java.awt.Color(0.3,0.3,0.3),3,true);
jEdit.repaint;             

% --- Method 1 - listbox to front - cancels border change
%uistack(hList,&#039;top&#039;);

% --- Method 2 - listbox to front - java error on figure closing
jObj = findjobj(hList); 
jPar = jObj.getParent;
jPar.getParent().setComponentZOrder(jPar, 0);
jPar.getParent().revalidate;

&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>Hello. I noticed that &#8216;uistack&#8217; call cancels border changes made with the suggested java method. <b>Is there a way to change stack order but still keep customized border? </b><br />
I&#8217;m trying &#8216;findjobj&#8217; &amp; &#8216;setComponentZOrder&#8217; combination. The latter works well, but when I attempt to close the figure I get &#8216;NullPointerException&#8217; error. See the code below. (Thanks a lot!!)</p>
<pre lang="matlab">

% --- Figure with listbox and editbox
f = figure; 
hList = uicontrol(f,'style','listbox','position',[10 10 400 20]);  
hEdit = uicontrol(f,'style','edit','position',[10 10 200 50]); 

% --- Change border of the editbox
jEdit = findjobj(hEdit);
jEdit.Border = javax.swing.border.LineBorder(java.awt.Color(0.3,0.3,0.3),3,true);
jEdit.repaint;             

% --- Method 1 - listbox to front - cancels border change
%uistack(hList,'top');

% --- Method 2 - listbox to front - java error on figure closing
jObj = findjobj(hList); 
jPar = jObj.getParent;
jPar.getParent().setComponentZOrder(jPar, 0);
jPar.getParent().revalidate;

</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Lemikainen		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-73086</link>

		<dc:creator><![CDATA[Lemikainen]]></dc:creator>
		<pubDate>Thu, 02 Feb 2012 09:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1947#comment-73086</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-73050&quot;&gt;Yair Altman&lt;/a&gt;.

thx for quick reply, already tried method you suggest yesterday but had some troubles and noticeable delay before changes are applied. Especially if i try to change border and background at the same time, it only changes one property and i have to rerun it to change all...  (changing foreground and background at the same time works)

Do you have any idea how to minimalize the delay before applying changes? 
here is the code i use
**************************************************************
&lt;pre lang=&#039;matlab&#039;&gt;
lineColor = java.awt.Color(1,1,1); 
thickness = 1; 
roundedCorners = false;
newBorder = javax.swing.border.LineBorder(lineColor,thickness,roundedCorners);

backgroundColor=java.awt.Color(0.141,0.518,1);
foregroundColor=java.awt.Color(1,1,1);
jButton = findjobj(&#039;class&#039;,&#039;pushbutton&#039;);       
length(jButton)

for i=1:1:length(jButton)
   set(jButton(i), &#039;Background&#039;, backgroundColor, &#039;Foreground&#039;, foregroundColor, &#039;Border&#039;, newBorder);
end
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-73050">Yair Altman</a>.</p>
<p>thx for quick reply, already tried method you suggest yesterday but had some troubles and noticeable delay before changes are applied. Especially if i try to change border and background at the same time, it only changes one property and i have to rerun it to change all&#8230;  (changing foreground and background at the same time works)</p>
<p>Do you have any idea how to minimalize the delay before applying changes?<br />
here is the code i use<br />
**************************************************************</p>
<pre lang='matlab'>
lineColor = java.awt.Color(1,1,1); 
thickness = 1; 
roundedCorners = false;
newBorder = javax.swing.border.LineBorder(lineColor,thickness,roundedCorners);

backgroundColor=java.awt.Color(0.141,0.518,1);
foregroundColor=java.awt.Color(1,1,1);
jButton = findjobj('class','pushbutton');       
length(jButton)

for i=1:1:length(jButton)
   set(jButton(i), 'Background', backgroundColor, 'Foreground', foregroundColor, 'Border', newBorder);
end
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-73050</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 01 Feb 2012 16:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1947#comment-73050</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-73049&quot;&gt;Lemikainen&lt;/a&gt;.

FindJObj *cannot* work in the GUIDE-created *_OpeningFcn because the figure is not yet visible at this time and so the Java components have still not rendered and therefore cannot be found.

Try placing your call to FindJObj *after* the figure has become visible and all the controls have completed rendering, for example by moving your FindJObj call to the *_OutputFcn function, hopefully after a call to &lt;i&gt;&lt;b&gt;drawnow&lt;/b&gt;&lt;/i&gt; to ensure that everything has completed rendering.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-73049">Lemikainen</a>.</p>
<p>FindJObj *cannot* work in the GUIDE-created *_OpeningFcn because the figure is not yet visible at this time and so the Java components have still not rendered and therefore cannot be found.</p>
<p>Try placing your call to FindJObj *after* the figure has become visible and all the controls have completed rendering, for example by moving your FindJObj call to the *_OutputFcn function, hopefully after a call to <i><b>drawnow</b></i> to ensure that everything has completed rendering.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Lemikainen		</title>
		<link>https://undocumentedmatlab.com/articles/customizing-uicontrol-border#comment-73049</link>

		<dc:creator><![CDATA[Lemikainen]]></dc:creator>
		<pubDate>Wed, 01 Feb 2012 16:44:34 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1947#comment-73049</guid>

					<description><![CDATA[Hi,
I´m having some troubles combining this way of setting parameters with GUI created using matlab GUIDE. Guide really doesn´t offer much customisation especially for button borders, colors and so on. 

My problem is, that i don´t know where exactly should i place the code, which changes button border... At first, I placed it logically into main figure opening function (executed before figure actually appears), but findjobj doesn´t find any java objects (it returns just empty array), although handle structure already consist of all matlab gui handles... it works If I change code and press, while app is already launched. (java objects existing...)

Do you have any suggestions how to solve my problem?]]></description>
			<content:encoded><![CDATA[<p>Hi,<br />
I´m having some troubles combining this way of setting parameters with GUI created using matlab GUIDE. Guide really doesn´t offer much customisation especially for button borders, colors and so on. </p>
<p>My problem is, that i don´t know where exactly should i place the code, which changes button border&#8230; At first, I placed it logically into main figure opening function (executed before figure actually appears), but findjobj doesn´t find any java objects (it returns just empty array), although handle structure already consist of all matlab gui handles&#8230; it works If I change code and press, while app is already launched. (java objects existing&#8230;)</p>
<p>Do you have any suggestions how to solve my problem?</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
