<?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: Using pure Java GUI in deployed Matlab apps	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-pure-java-gui-in-deployed-matlab-apps</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Tue, 12 Mar 2019 18:05:49 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.3</generator>
	<item>
		<title>
		By: James		</title>
		<link>https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-467135</link>

		<dc:creator><![CDATA[James]]></dc:creator>
		<pubDate>Tue, 12 Mar 2019 18:05:49 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=4909#comment-467135</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-435671&quot;&gt;Peng Zheng&lt;/a&gt;.

Looks like I am seeing the same issue. I was able to work around the error in 2017a+ by just adding an invisible figure and having the program wait for it. 
&lt;pre lang=&quot;matlab&quot;&gt;
fig = figure(&#039;Visible&#039;,0);
jFrame.setVisible(true);
if isdeployed
    waitfor(fig);
end
&lt;/pre&gt;

Then we need to do a system exit, not dispose, I think to cleanly remove the figure. Hopefully there is a better implementation, but it works for now.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-435671">Peng Zheng</a>.</p>
<p>Looks like I am seeing the same issue. I was able to work around the error in 2017a+ by just adding an invisible figure and having the program wait for it. </p>
<pre lang="matlab">
fig = figure('Visible',0);
jFrame.setVisible(true);
if isdeployed
    waitfor(fig);
end
</pre>
<p>Then we need to do a system exit, not dispose, I think to cleanly remove the figure. Hopefully there is a better implementation, but it works for now.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-460294</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 05 Feb 2019 14:41:12 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=4909#comment-460294</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-459572&quot;&gt;Lukasz&lt;/a&gt;.

Alternatively, set the Java frame&#039;s default close operation to DISPOSE_ON_CLOSE, as follows:
&lt;pre lang=&quot;matlab&quot;&gt;jFrame.setDefaultCloseOperation(jFrame.DISPOSE_ON_CLOSE);  % rather than EXIT_ON_CLOSE&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-459572">Lukasz</a>.</p>
<p>Alternatively, set the Java frame&#8217;s default close operation to DISPOSE_ON_CLOSE, as follows:</p>
<pre lang="matlab">jFrame.setDefaultCloseOperation(jFrame.DISPOSE_ON_CLOSE);  % rather than EXIT_ON_CLOSE</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-460252</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Tue, 05 Feb 2019 09:44:44 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=4909#comment-460252</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-460250&quot;&gt;Michael&lt;/a&gt;.

@Michael - look here: &lt;a href=&quot;http://undocumentedmatlab.com/blog/modifying-matlab-look-and-feel&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://undocumentedmatlab.com/blog/modifying-matlab-look-and-feel&lt;/a&gt;
You&#039;d probably want to modify the L&amp;F only during your figure creation, and restore it back to the default immediately following the GUI creation.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-460250">Michael</a>.</p>
<p>@Michael &#8211; look here: <a href="http://undocumentedmatlab.com/blog/modifying-matlab-look-and-feel" target="_blank" rel="nofollow">http://undocumentedmatlab.com/blog/modifying-matlab-look-and-feel</a><br />
You&#8217;d probably want to modify the L&#038;F only during your figure creation, and restore it back to the default immediately following the GUI creation.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Michael		</title>
		<link>https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-460250</link>

		<dc:creator><![CDATA[Michael]]></dc:creator>
		<pubDate>Tue, 05 Feb 2019 09:31:47 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=4909#comment-460250</guid>

					<description><![CDATA[Hi Yair, 
thanks very much for this great site and books! This is probably the wrong place to ask a question, so sorry beforehand. I am using Matlab 2015b on Windows 7. I have a function that generates a figure with Java tables, with the standard Windows laf. I tried to change the highlight colour for the text in my figure in the following way:
&lt;pre lang=&quot;matlab&quot;&gt;
defaults = javax.swing.UIManager.getLookAndFeelDefaults();
defaults.put(&#039;textHighlight&#039;, java.awt.Color(1, 0, 0));
&lt;/pre&gt;
As the result the text highlighting of the Matlab Command window changes to red colour, but nothing changes in any of the figures. Pausing and drawnow doesn&#039;t help. Is there a workaround?]]></description>
			<content:encoded><![CDATA[<p>Hi Yair,<br />
thanks very much for this great site and books! This is probably the wrong place to ask a question, so sorry beforehand. I am using Matlab 2015b on Windows 7. I have a function that generates a figure with Java tables, with the standard Windows laf. I tried to change the highlight colour for the text in my figure in the following way:</p>
<pre lang="matlab">
defaults = javax.swing.UIManager.getLookAndFeelDefaults();
defaults.put('textHighlight', java.awt.Color(1, 0, 0));
</pre>
<p>As the result the text highlighting of the Matlab Command window changes to red colour, but nothing changes in any of the figures. Pausing and drawnow doesn&#8217;t help. Is there a workaround?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Lukasz		</title>
		<link>https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-459572</link>

		<dc:creator><![CDATA[Lukasz]]></dc:creator>
		<pubDate>Fri, 01 Feb 2019 16:32:32 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=4909#comment-459572</guid>

					<description><![CDATA[To avoid the closing problem (closing the window also closes JVM/Matlab), it is enough to implement the &lt;code&gt;WindowListener&lt;/code&gt; interface and overwrite the &lt;i&gt;windowClosing&lt;/i&gt; method, so there is no &lt;code&gt;EXIT_ON_CLOSE&lt;/code&gt; (i.e. System.exit(0)).

E.g.
&lt;pre lang=&quot;java&quot;&gt;
public class JavaWindow
        extends JFrame implements WindowListener{
...
@Override
    public void windowClosing(WindowEvent e) {
        
    }
&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>To avoid the closing problem (closing the window also closes JVM/Matlab), it is enough to implement the <code>WindowListener</code> interface and overwrite the <i>windowClosing</i> method, so there is no <code>EXIT_ON_CLOSE</code> (i.e. System.exit(0)).</p>
<p>E.g.</p>
<pre lang="java">
public class JavaWindow
        extends JFrame implements WindowListener{
...
@Override
    public void windowClosing(WindowEvent e) {
        
    }
</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Eddie		</title>
		<link>https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-458978</link>

		<dc:creator><![CDATA[Eddie]]></dc:creator>
		<pubDate>Tue, 29 Jan 2019 23:48:55 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=4909#comment-458978</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-435671&quot;&gt;Peng Zheng&lt;/a&gt;.

I have this same issue on r2018b. 

The line &#039;waitfor(jframe)&#039; does not work any more, resulting in error &#039;conversion to double from jframe is not possible&#039;]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-435671">Peng Zheng</a>.</p>
<p>I have this same issue on r2018b. </p>
<p>The line &#8216;waitfor(jframe)&#8217; does not work any more, resulting in error &#8216;conversion to double from jframe is not possible&#8217;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Peng Zheng		</title>
		<link>https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-435671</link>

		<dc:creator><![CDATA[Peng Zheng]]></dc:creator>
		<pubDate>Wed, 15 Aug 2018 16:45:24 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=4909#comment-435671</guid>

					<description><![CDATA[Hi Yair,

I tried to run the example, and compiled the example (matlab 2017a). It works for a few minutes, but a new problem appears, the exe crashed with a error (&quot;jframe cannot convert to double&quot;). Do you have any idea how to solve this?
Kind regards]]></description>
			<content:encoded><![CDATA[<p>Hi Yair,</p>
<p>I tried to run the example, and compiled the example (matlab 2017a). It works for a few minutes, but a new problem appears, the exe crashed with a error (&#8220;jframe cannot convert to double&#8221;). Do you have any idea how to solve this?<br />
Kind regards</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-404882</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 13 Apr 2017 13:36:27 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=4909#comment-404882</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-404880&quot;&gt;zb&lt;/a&gt;.

@zb - this is not the problem; the problem is that you try to set the callback on a naked Java reference instead of on the handle() of that reference. Read the blog post that I mentioned carefully and then fix your code.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-404880">zb</a>.</p>
<p>@zb &#8211; this is not the problem; the problem is that you try to set the callback on a naked Java reference instead of on the handle() of that reference. Read the blog post that I mentioned carefully and then fix your code.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: zb		</title>
		<link>https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-404880</link>

		<dc:creator><![CDATA[zb]]></dc:creator>
		<pubDate>Thu, 13 Apr 2017 13:08:20 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=4909#comment-404880</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-404858&quot;&gt;zb&lt;/a&gt;.

i know what is the problem , i use matlab 2016b. My friend with matlab2013a doesn&#039;t have the same problem and it works well. 
Do you know why there are those changes in the new version of Matlab?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-404858">zb</a>.</p>
<p>i know what is the problem , i use matlab 2016b. My friend with matlab2013a doesn&#8217;t have the same problem and it works well.<br />
Do you know why there are those changes in the new version of Matlab?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: zb		</title>
		<link>https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-404872</link>

		<dc:creator><![CDATA[zb]]></dc:creator>
		<pubDate>Thu, 13 Apr 2017 11:32:43 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=4909#comment-404872</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-404858&quot;&gt;zb&lt;/a&gt;.

Sadly, even by using handle(jFrame,&#039;CallbackProperties&#039;) , it doesnt work : 

The name &#039;ComponentResizedCallback&#039; is not an accessible property for an instance of class
&#039;javax.swing.JFrame&#039;.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/using-pure-java-gui-in-deployed-matlab-apps#comment-404858">zb</a>.</p>
<p>Sadly, even by using handle(jFrame,&#8217;CallbackProperties&#8217;) , it doesnt work : </p>
<p>The name &#8216;ComponentResizedCallback&#8217; is not an accessible property for an instance of class<br />
&#8216;javax.swing.JFrame&#8217;.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
