addlistener Add a listener to a Java object.
L=addlistener(JObject, EventName, Callback)
Adds a listener to the specified Java object for the given
event name. The listener will stop firing when the return
value L goes out of scope.
addlistener(JObject)
Lists all the available event names.
Examples:
jf = javaObjectEDT('javax.swing.JFrame');
addlistener(jf) % list all events
% Basic string eval callback:
addlistener(jf,'WindowClosing','disp closing')
% Function handle callback
addlistener(jf,'WindowClosing',@(o,e) disp(e))
Overloaded methods:
handle/addlistener
opaque/addlistener
Partager