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. Is there some way to run the Java app from Matlab and get a handle to it?
> 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" <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
>
"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.
"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.