javax.microedition.lcdui
Class Screen

java.lang.Object
  |
  +--javax.microedition.lcdui.Displayable
        |
        +--javax.microedition.lcdui.Screen
Direct Known Subclasses:
Alert, Form, List, TextBox

public abstract class Screen
extends Displayable

The common superclass of all high-level user interface classes. Adds optional title and ticker-tape output to the Displayable class. The contents displayed and their interaction with the user are defined by subclasses.

Using subclass-defined methods, the application may change the contents of a Screen object while it is shown to the user. If this occurs, and the Screen object is visible, the display will be updated automatically. That is, the implementation will refresh the display in a timely fashion without waiting for any further action by the application. For example, suppose a List object is currently displayed, and every element of the List is visible. If the application inserts a new element at the beginning of the List, it is displayed immediately, and the other elements will be rearranged appropriately. There is no need for the application to call another method to refresh the display.

It is recommended that applications change the contents of a Screen only while it is not visible (that is, while another Displayable is current). Changing the contents of a Screen while it is visible may result in performance problems on some devices, and it may also be confusing if the Screen's contents changes while the user is interacting with it.


Method Summary
 Ticker getTicker()
          Gets the ticker used by this Screen.
 String getTitle()
          Gets the title of the Screen.
 void setTicker(Ticker ticker)
          Set a ticker for use with this Screen, replacing any previous ticker.
 void setTitle(String s)
          Sets the title of the Screen.
 
Methods inherited from class javax.microedition.lcdui.Displayable
addCommand, getHeight, getWidth, isShown, removeCommand, setCommandListener, sizeChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTitle

public String getTitle()
Gets the title of the Screen. Returns null if there is no title.
Overrides:
getTitle in class Displayable
Following copied from class: javax.microedition.lcdui.Displayable
Returns:
the title of the instance, or null if no title
See Also:
Displayable.setTitle(java.lang.String)

setTitle

public void setTitle(String s)
Sets the title of the Screen. If null is given, removes the title.

If the Screen is physically visible, the visible effect should take place no later than immediately after the callback or startApp returns back to the implementation.

Overrides:
setTitle in class Displayable
Parameters:
s - the new title, or null for no title
Since:
JDE 4.0.2

setTicker

public void setTicker(Ticker ticker)
Set a ticker for use with this Screen, replacing any previous ticker. If null, removes the ticker object from this screen. The same ticker is may be shared by several Screen objects within an application. This is done by calling setTicker() on different screens with the same Ticker object. If the Screen is physically visible, the visible effect should take place no later than immediately after the callback or startApp returns back to the implementation.
Overrides:
setTicker in class Displayable
Parameters:
ticker - the ticker object used on this screen
Since:
JDE 4.0.2

getTicker

public Ticker getTicker()
Gets the ticker used by this Screen.
Overrides:
getTicker in class Displayable
Returns:
ticker object used, or null if no ticker is present


Copyright 1999-2004 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.