Name
CommandListener
Synopsis
An interface implemented by objects that want to be notified when the user activates
a Command associated with a Displayable. A
Displayable can have a single CommandListener,
set using its setCommandListener() method.
When any Command
on a Displayable is activated, its CommandListener’s
commandAction() method is called. In order to allow a single
listener to handle the actions associated with more than one Command,
this method receives a reference to both the Command itself
and the Displayable that this instance of the
Command is associated with. The commandAction()
method is typically invoked in the context of the thread that is responsible for managing
the user interface and therefore any delay caused by this method may cause the user interface
to appear to be unresponsive.
public interface CommandListener { // Public Instance Methods public abstract void commandAction(Command c, Displayable d); }
Passed To
Alert.setCommandListener(), Displayable.setCommandListener()
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access