Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to notify Matlab about Java object change in Matlab Java
Date: Tue, 21 Apr 2009 16:59:02 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 14
Message-ID: <gsku0m$dg8$1@fred.mathworks.com>
References: <83292fe2-d12d-402a-8f5c-8c24f9752d9b@c36g2000yqn.googlegroups.com> <8c2c62b6-88c3-4640-84a8-af1528ff6d7a@w40g2000yqd.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1240333142 13832 172.30.248.37 (21 Apr 2009 16:59:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 21 Apr 2009 16:59:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: news.mathworks.com comp.soft-sys.matlab:534448


> It looks I will use it in the case I won't find a way to set a Matlab
> callback from standard java JFrame container ( instead of embedding
> swing components into Matlab figure )

You can set Matlab callbacks for any Java object (including your JFrame) as follows:

hObject = handle(jObject,'callbackProperties');  % jObject is your java object reference
set(hObject,'WidowIconifiedCallback',@myMatlabFcn);  % for example

To see the list of all supported callbacks etc., you can use my UIINSPECT (http://www.mathworks.com/matlabcentral/fileexchange/17935 ) or FINDJOBJ (http://www.mathworks.com/matlabcentral/fileexchange/14317 ) submissions on the File Exchange.

Yair Altman
http://UndocumentedMatlab.com