Skip to Main Content Skip to Search
Product Documentation

javaMethodEDT - Invoke Java method from Event Dispatch Thread (EDT)

Syntax

javaMethodEDT(MethodName,ClassName,x1,...,xn)
javaMethodEDT(MethodName,JavaObj,x1,...,xn)

Description

javaMethodEDT(MethodName,ClassName,x1,...,xn) invokes the Java class method with the specified input arguments from the Event Dispatch Thread (EDT).

javaMethodEDT(MethodName,JavaObj,x1,...,xn) invokes a nonstatic method on a Java object array.

Input Arguments

MethodName

String representing method in Java ClassName class.

ClassName

String representing Java class containing MethodName.

x1,...,xn

Input arguments matching MethodName signature.

JavaObj

Java object array.

Examples

Invoke the static method setDefaultLookAndFeelDecorated in class javax.swing.JFrame:

javaMethodEDT('setDefaultLookAndFeelDecorated', 'javax.swing.JFrame', true)
 

Create a vector v on the MATLAB thread and invoke the add method from the EDT.

v = java.util.Vector;
javaMethodEDT('add',v,'string');

See Also

import | isjava | javaMethod | javaObjectEDT | methods

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS