public class MathActionListener extends MathListener implements java.awt.event.ActionListener
In response to an ActionEvent, objects of this class send to Mathematica:
userFunc[theActionEvent, theActionEvent.getActionCommand()]userFunc is specified as a string, either a function name or an expression (like a pure function "foo[##]&"), via the setHandler() method. Sending the result of getActionCommand() is an optimization to avoid a call back to Java in the likely event that you want this value.
|Constructor and Description|
The constructor that is typically called from Mathematica.
You must use this constructor when using this class in a Java program, because you need to specify the KernelLink that will be used.
Because the ActionListener interface has only one method, actionPerformed(), you can specify the Mathematica function to be called with this constructor, rather than having to separately call setHandler().
|Modifier and Type||Method and Description|
callMathHandler, callVoidMathHandler, getHandler, getLink, setHandler
public MathActionListener(KernelLink ml)
ml- The link to which computations will be sent when actionPerformed() is called.
public MathActionListener(java.lang.String func)
func- The Mathematica function to be executed in response to an ActionEvent.
J/Link is Copyright (c) 1999-2016, Wolfram Research, Inc. All rights reserved.