|
bind() binds a callback function to component. When some event associated with action occur for component the bound function is called with the event object as parameter.
unbind() cancels a callback function to component.
e.g.
import("java.awt.*") f = frame("title") f.setLayout(FlowLayout()) f.add(b1 = Button("OK")) f.show() bind(b1, "actionPerformed", function (e) println("hello"))
action is one of the followings.
"actionPerformed" "java.awt.event.ActionListener.actionPerformed"
Method names of java.awt.event.XXXListener class are pre-defined as action.
|
registerEventListener() registers methods of a concrete EventListener class.
e.g.registerEventListener(PropertyChangeListener) bind (aBean, "propertyChange", func)