|
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.
callBackFunction(EventObject eventObject)
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"