Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: accessing java gui from Matlab
Date: Tue, 7 Apr 2009 17:24:21 -0400
Organization: The MathWorks, Inc.
Lines: 41
Message-ID: <grgg92$t12$1@fred.mathworks.com>
References: <gr8en1$g1v$1@fred.mathworks.com> <gr8fh9$7bc$1@fred.mathworks.com> <grdc8t$5j1$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1239139426 29730 144.212.105.187 (7 Apr 2009 21:23:46 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 7 Apr 2009 21:23:46 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:531185



"Todd Welti" <twelti@harman.com> wrote in message 
news:grdc8t$5j1$1@fred.mathworks.com...
> "Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message 
> <gr8fh9$7bc$1@fred.mathworks.com>...
>> > Is there any way to access an object in a separate Java gui from 
>> > matlab?  I am running a Java gui (not running from Matlab) and also an 
>> > app in Matlab.  I would like to access the Java gui from Matlab (and 
>> > changel a slider value in the Java app).  I'm guessing this might be 
>> > impossible.
>>
>> Correct - AFAIK you cannot access a Java frame from another JVM.
>>
>> > Is there some way to run the Java app from Matlab and get a handle to 
>> > it?
>>
>> Yes - Matlab runs its own JVM and can run Java classes directly. You will 
>> then have access to your Java GUI and can manipulate it from within 
>> Matlab.
>>
>> Yair Altman
>> http://UndocumentedMatlab.com
>>
>
> ... the Java app is normally run from a bat file:
>
> @echo off
> java -classpath .;.\jna.jar com.hbas.asioConvGui.ASIOConvGUI > log.txt
>
> I tried running this direcly in Matlab, but didn't work.

Open up the Help Browser using the DOC function.  In the main MATLAB 
documentation there's a chapter titled "External Interfaces".  One of the 
sections of that chapter describes the steps you'll need to follow to use 
Java from within MATLAB.

-- 
Steve Lord
slord@mathworks.com