javax.microedition.lcdui
Class StringItem

java.lang.Object
  |
  +--javax.microedition.lcdui.Item
        |
        +--javax.microedition.lcdui.StringItem

public class StringItem
extends Item

An item that can contain a string. A StringItem is display-only; the user cannot edit the contents. Both the label and the textual content of a StringItem may be modified by the application. The visual representation of the label may differ from that of the textual contents.


Constructor Summary
StringItem(String label, String text)
          Creates a new StringItem object with the given label and textual content.
 
Method Summary
 String getLabel()
          Gets the label of this Item object.
 String getText()
          Gets the text contents of the StringItem, or null if the StringItem is empty.
 void setLabel(String label)
          Sets the label of the Item.
 void setText(String text)
          Sets the text contents of the StringItem.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringItem

public StringItem(String label,
                  String text)
Creates a new StringItem object with the given label and textual content. Either label or text may be present or null.
Parameters:
label - the Item label
text - the text contents
Method Detail

getText

public String getText()
Gets the text contents of the StringItem, or null if the StringItem is empty.
Returns:
a string with the content of the item

setText

public void setText(String text)
Sets the text contents of the StringItem. If text is null, the StringItem is set to be empty.
Parameters:
text - the new content
Since:
JDE 3.6

setLabel

public void setLabel(String label)
Description copied from class: Item
Sets the label of the Item. If label is null, specifies that this item has no label.
Overrides:
setLabel in class Item
Since:
JDE 3.6

getLabel

public String getLabel()
Description copied from class: Item
Gets the label of this Item object.
Overrides:
getLabel in class Item
Following copied from class: javax.microedition.lcdui.Item
Returns:
the label string


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