Adds an ActionLister to component. When the action fires, f will be
invoked with the event as its first argument followed by args.
Returns the listener.
(defn add-action-listener
"Adds an ActionLister to component. When the action fires, f will be
invoked with the event as its first argument followed by args.
Returns the listener."
[component f & args]
(let [listener (proxy [ActionListener] []
(actionPerformed [event] (apply f event args)))]
(.addActionListener component listener)
listener))
Comments top
No comments for add-action-listener. Log in to add a comment.