DCT Lightfoot v3 API specification

javax.microedition.lcdui
Class Form

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

public class Form
extends Screen

A form contains items for displaying on a screen


Field Summary
 
Fields inherited from class javax.microedition.lcdui.Screen
height, offset
 
Fields inherited from class javax.microedition.lcdui.Displayable
display
 
Constructor Summary
Form(java.lang.String title)
          Create a new form with the title
Form(java.lang.String title, Item[] items)
          Create a new form pre-populated with items
 
Method Summary
 int append(Image img)
          Append an image
 int append(Item item)
          Append an item
 int append(java.lang.String str)
          Append a string to the items
 void delete(int pos)
          Delete the item at the specified position
 Item get(int pos)
          Get the item at the specified position
 void insert(int pos, Item item)
          Insert an item into the form just before the specified position
 void keyPressed(int code)
          Handle a key press.
 void set(int pos, Item item)
          Set the item at the specified position to a new item
 void setItemStateListener(ItemStateListener iListener)
          Set the item state listener
 int size()
          Return the number of items in this form
 
Methods inherited from class javax.microedition.lcdui.Screen
getTicker, getTitle, scrollDown, scrollUp, setTicker, setTitle
 
Methods inherited from class javax.microedition.lcdui.Displayable
addCommand, isShown, removeCommand, setCommandListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Form

public Form(java.lang.String title)
Create a new form with the title

Parameters:
title - The title

Form

public Form(java.lang.String title,
            Item[] items)
Create a new form pre-populated with items

Parameters:
title - The title
items - The items
Method Detail

append

public int append(Image img)
Append an image

Parameters:
img - The image
Returns:
the index of the item

append

public int append(Item item)
Append an item

Parameters:
item - The item to append
Returns:
the index of the item

append

public int append(java.lang.String str)
Append a string to the items

Parameters:
str - The string
Returns:
the position of the string

delete

public void delete(int pos)
Delete the item at the specified position

Parameters:
pos - The position of the item to delete
Throws:
IndexOutOfBoundsException - if the number is invalid

get

public Item get(int pos)
Get the item at the specified position

Parameters:
pos - The position to get the item from
Returns:
the item
Throws:
IndexOutOfBoundsException - if the position is invalid

insert

public void insert(int pos,
                   Item item)
Insert an item into the form just before the specified position

Parameters:
pos - The position
item - The item
Throws:
IndexOutOfBoundsException - if the position is invalid
NullPointerException - if the item is null

set

public void set(int pos,
                Item item)
Set the item at the specified position to a new item

Parameters:
pos - The position
item - The new item
Throws:
IndexOutOfBoundsException - if the position is invalid
NullPointerException - if the item is null

setItemStateListener

public void setItemStateListener(ItemStateListener iListener)
Set the item state listener

Parameters:
iListener - the listener

size

public int size()
Return the number of items in this form

Returns:
the items

keyPressed

public void keyPressed(int code)
Handle a key press. We use up down to go between entries

Overrides:
keyPressed in class Screen
Parameters:
code - The code

DCT Lightfoot v3 API specification

DCT Lightfoot v3 API specification