Documentation Center

  • Trials
  • Product Updates

javaObjectEDT

Call Java constructor on Event Dispatch Thread (EDT)

Syntax

  • JavaObj = javaObjectEDT(ClassName,x1,...,xN) example

Description

example

JavaObj = javaObjectEDT(ClassName,x1,...,xN) returns Java® object array, JavaObj, created from the EDT by the Java constructor for the class with the signature matching the arguments x1,...,xN.

Examples

expand all

Construct Java Object Array from the EDT

f = javaObjectEDT('javax.swing.JFrame','New Title');

Call Method on Java Object

Create a JOptionPane on the EDT.

optPane = javaObjectEDT('javax.swing.JOptionPane');

Call the createDialog method on the EDT.

dlg = optPane.createDialog([],'Sample Dialog');

Input Arguments

expand all

ClassName — Name of Java classstring

Name of Java class, specified as a string.

Data Types: char

x1,...,xN — Java constructor input argumentsany type

Java constructor input arguments, 1 through N (if any), required by ClassName, specified by any type. The argument type is specified by the class constructor argument list.

More About

expand all

EDT

The EDT is the Event Dispatch Thread, used in Java.

Tips

  • MATLAB® calls methods on JavaObj from the EDT.

  • Static methods on the specified class or Java object run on the MATLAB thread unless called using the javaMethodEDT function.

See Also

| | |

Was this topic helpful?