<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/249572</link>
    <title>MATLAB Central Newsreader - How to notify Matlab about Java object change in Matlab Java </title>
    <description>Feed for thread: How to notify Matlab about Java object change in Matlab Java </description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 21 Apr 2009 14:26:35 -0400</pubDate>
      <title>How to notify Matlab about Java object change in Matlab Java </title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/249572#644359</link>
      <author>St. Gold</author>
      <description>Hello,&lt;br&gt;
&lt;br&gt;
Does anybody has any idea how to update Matlab function about Java&lt;br&gt;
object change ?&lt;br&gt;
&lt;br&gt;
It could be done by polling:&lt;br&gt;
&lt;br&gt;
while JavaObj.getValue()=='not done yet'&lt;br&gt;
&amp;nbsp;&amp;nbsp;pause(1);&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
But polling is evil. There should be more elegant way to do this&lt;br&gt;
job ...&lt;br&gt;
&lt;br&gt;
I've checked 'Matlab Java Interface' docs :&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/f6671.html&quot;&gt;http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/f6671.html&lt;/a&gt;&lt;br&gt;
, but found nothing on the subject :(&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Thanks in advance for your help,</description>
    </item>
    <item>
      <pubDate>Tue, 21 Apr 2009 14:44:02 -0400</pubDate>
      <title>Re: How to notify Matlab about Java object change in Matlab Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/249572#644363</link>
      <author>Malcolm Lidierth</author>
      <description>Could you use javacomponent to set up the object, and set a callback to repond to the changed value?</description>
    </item>
    <item>
      <pubDate>Tue, 21 Apr 2009 15:42:15 -0400</pubDate>
      <title>Re: How to notify Matlab about Java object change in Matlab Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/249572#644376</link>
      <author>stasgold</author>
      <description>On Apr 21, 5:44=A0pm, &quot;Malcolm Lidierth&quot; &amp;lt;ku.ca....@htreidil.mloclam&amp;gt;&lt;br&gt;
wrote:&lt;br&gt;
&amp;gt; Could you use javacomponent to set up the object, and set a callback to r=&lt;br&gt;
espond to the changed value?&lt;br&gt;
&lt;br&gt;
Hi Malcolm Lidierth,&lt;br&gt;
&lt;br&gt;
I had no clue about javacomponent  existence (no wonder it's&lt;br&gt;
undocumented ), thanks for providing the feedback :)&lt;br&gt;
&lt;br&gt;
It looks I will use it in the case I won't find a way to set a Matlab&lt;br&gt;
callback from standard java JFrame container ( instead of embedding&lt;br&gt;
swing components into Matlab figure )&lt;br&gt;
&lt;br&gt;
I've checked out a possible usage of &quot;waitfor&quot; for this purpose :&lt;br&gt;
&lt;br&gt;
waitfor(JavaObj,some_field,value)&lt;br&gt;
&lt;br&gt;
It doesn't seem to work :(&lt;br&gt;
&lt;br&gt;
Maybe someone of matlab developers would be so nice to share with us&lt;br&gt;
his thoughts on this subject ... :)</description>
    </item>
    <item>
      <pubDate>Tue, 21 Apr 2009 16:13:02 -0400</pubDate>
      <title>Re: How to notify Matlab about Java object change in Matlab Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/249572#644380</link>
      <author>Malcolm Lidierth</author>
      <description>If you are using swing components, you might take a look at Yair Altman's uicomponent or my own jcontrol class on the FEX. &lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/15580&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/15580&lt;/a&gt;&lt;br&gt;
Both provide access to the MATLAB container and the underlying swing component through a single object.&lt;br&gt;
A MATLAB figure can not parent a JFrame to the best of my knowledge but you can build GUIs in e.g. a JPanel contained in an ML figure easily enough.</description>
    </item>
    <item>
      <pubDate>Tue, 21 Apr 2009 16:59:02 -0400</pubDate>
      <title>Re: How to notify Matlab about Java object change in Matlab Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/249572#644403</link>
      <author>Yair Altman</author>
      <description>&amp;gt; It looks I will use it in the case I won't find a way to set a Matlab&lt;br&gt;
&amp;gt; callback from standard java JFrame container ( instead of embedding&lt;br&gt;
&amp;gt; swing components into Matlab figure )&lt;br&gt;
&lt;br&gt;
You can set Matlab callbacks for any Java object (including your JFrame) as follows:&lt;br&gt;
&lt;br&gt;
hObject = handle(jObject,'callbackProperties');  % jObject is your java object reference&lt;br&gt;
set(hObject,'WidowIconifiedCallback',@myMatlabFcn);  % for example&lt;br&gt;
&lt;br&gt;
To see the list of all supported callbacks etc., you can use my UIINSPECT (&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/17935&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/17935&lt;/a&gt; ) or FINDJOBJ (&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/14317&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/14317&lt;/a&gt; ) submissions on the File Exchange.&lt;br&gt;
&lt;br&gt;
Yair Altman&lt;br&gt;
&lt;a href=&quot;http://UndocumentedMatlab.com&quot;&gt;http://UndocumentedMatlab.com&lt;/a&gt; &lt;br&gt;
&amp;nbsp;</description>
    </item>
    <item>
      <pubDate>Wed, 22 Apr 2009 07:43:09 -0400</pubDate>
      <title>Re: How to notify Matlab about Java object change in Matlab Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/249572#644571</link>
      <author>stasgold</author>
      <description>On Apr 21, 7:59=A0pm, &quot;Yair Altman&quot; &amp;lt;altmany...@gmailDEL.comDEL&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; It looks I will use it in the case I won't find a way to set a Matlab&lt;br&gt;
&amp;gt; &amp;gt; callback from standard java JFrame container ( instead of embedding&lt;br&gt;
&amp;gt; &amp;gt; swing components into Matlab figure )&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; You can set Matlab callbacks for any Java object (including your JFrame) =&lt;br&gt;
as follows:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; hObject =3D handle(jObject,'callbackProperties'); =A0% jObject is your ja=&lt;br&gt;
va object reference&lt;br&gt;
&amp;gt; set(hObject,'WidowIconifiedCallback',@myMatlabFcn); =A0% for example&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; To see the list of all supported callbacks etc., you can use my UIINSPECT=&lt;br&gt;
&amp;nbsp;(&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/17935)&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/17935)&lt;/a&gt; or FINDJOBJ (h=&lt;br&gt;
ttp://www.mathworks.com/matlabcentral/fileexchange/14317) submissions on th=&lt;br&gt;
e File Exchange.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Yair Altman&lt;a href=&quot;http://UndocumentedMatlab.com&quot;&gt;http://UndocumentedMatlab.com&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Thanks Yair,&lt;br&gt;
&lt;br&gt;
Your post helped me big way. I just wonder how your tools are not yet&lt;br&gt;
a part of standard Matlab distribution ...&lt;br&gt;
&lt;br&gt;
UndocumentedMatlab.com is bookmarked as well :) Keep up the good work.</description>
    </item>
    <item>
      <pubDate>Tue, 28 Jul 2009 09:47:03 -0400</pubDate>
      <title>Re: How to notify Matlab about Java object change in Matlab Java</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/249572#668711</link>
      <author>Yair Altman</author>
      <description>For those interested, I posted an article about undocumented Matlab-Java callbacks here: &lt;a href=&quot;http://undocumentedmatlab.com/blog/uicontrol-callbacks/&quot;&gt;http://undocumentedmatlab.com/blog/uicontrol-callbacks/&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
Yair Altman&lt;br&gt;
&lt;a href=&quot;http://UndocumentedMatlab.com&quot;&gt;http://UndocumentedMatlab.com&lt;/a&gt;</description>
    </item>
  </channel>
</rss>

