Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| MID Profile
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.microedition.lcdui
Class Displayable

    java.lang.Object
      |
      +--javax.microedition.lcdui.Displayable

Direct Known Subclasses:
  Canvas, Screen

public abstract class Displayable
extends Object

An object that has the capability of being placed on the display. A Displayable object may have commands and listeners associated with it. The contents displayed and their interaction with the user are defined by subclasses.

Method Summary
`void` | `addCommand(Command cmd)` Adds a command to the Displayable.
`boolean` | `isShown()` Checks if the Displayable is actually visible on the display.
`void` | `removeCommand(Command cmd)` Removes a command from the Displayable.
`void` | `setCommandListener(CommandListener l)` Sets a listener for `Commands` to this Displayable, replacing any previous CommandListener.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### isShown

    public boolean isShown()

  Checks if the Displayable is actually visible on the display. In order for a Displayable to be visible, all of the following must be true: the Display's MIDlet must be running in the foreground, the Displayable must be the Display's current screen, and the Displayable must not be obscured by a system screen.
  Returns:
    true if the Displayable is currently visible

### addCommand

    public void addCommand(Command cmd)

  Adds a command to the Displayable. The implementation may choose, for example, to add the command to any of the available softbuttons or place it in a menu. If the added command is already in the screen (tested by comparing the object references), the method has no effect. If the Displayable is actually visible on the display, and this call affects the set of visible commands, the implementation should update the display as soon as it is feasible to do so.
  Parameters:
    `cmd` - the command to be added

### removeCommand

    public void removeCommand(Command cmd)

  Removes a command from the Displayable. If the command is not in the Displayable (tested by comparing the object references), the method has no effect. If the Displayable is actually visible on the display, and this call affects the set of visible commands, the implementation should update the display as soon as it is feasible to do so.
  Parameters:
    `cmd` - the command to be removed

### setCommandListener

    public void setCommandListener(CommandListener l)

  Sets a listener for `Commands` to this Displayable, replacing any previous CommandListener. A `null` reference is allowed and has the effect of removing any existing listener.
  Parameters:
    `l` - the new listener, or `null`.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| MID Profile
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a comment or suggestion Version 0.95 of MID Profile Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,Palo Alto, California, 94303, U.S.A. All Rights Reserved.