Name
Displayable
Synopsis
Displayable is an abstract base class for objects that can be shown
by a Display.
The addCommand() method
provides the ability to associate one or more Commands with the
displayable object. The way in which these Commands are represented
in the user interface is platform-dependent, but would normally involve one or both of
a button and a menu item. A Command may be removed using the
removeCommand() method.
The setCommandListener() allows a
single CommandListener to be registered to be notified when a
Command is activated. If this method is called when a listener is
already registered, the original listener is removed and will not receive further
event notifications. Calling this method with argument null
removes any registered listener.
The isShown() method can be used to determine whether the
Displayable is currently visible. This method returns
true when the owning MIDlet is in the foreground and the
Displayable is the object currently displayed by its
Display.
public abstract class Displayable { // No Constructor // Public Instance Methods public void addCommand( Command cmd); public boolean isShown(); public void removeCommand( Command cmd); public void setCommandListener( CommandListener l); }
Subclasses
Canvas, Screen
Passed To
CommandListener.commandAction(), Display.setCurrent()
Returned By
Display.getCurrent()
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