moka.x
Class TextField

java.lang.Object
  extended bymoka.lang.Object
      extended bymoka.event.EventListener
          extended bymoka.x.Component
              extended bymoka.x.CaptionedComponent
                  extended bymoka.x.TextField
All Implemented Interfaces:
Captioned

public class TextField
extends CaptionedComponent

TextField class is a text entry component.

Since:
MDK1.0a

Field Summary
static short CHAR_INPUT_TYPE
          The TextField only accepts characters.
static short FLOAT_INPUT_TYPE
          The TextField only accepts integers and floats.
 short inputType
          The input type of this TextField
static short INT_INPUT_TYPE
          The TextField only accepts integers.
 char mask
          The mask for this TextField.
 short maxLength
          The number of character this TextField should accept.
static short NO_INPUT_TYPE
          The TextField accepts any character.
 
Fields inherited from class moka.x.Component
enabled, height, listen, mnemonic, next, parent, prev, visible, width, x, y
 
Fields inherited from interface moka.x.Captioned
caption, font
 
Constructor Summary
TextField()
           
TextField(java.lang.String caption)
           
 
Method Summary
 void paint()
          Paints the textfield.
 void setMask(char mask)
          Sets the mask of the TextField.
 void use()
          This method is invoked by the GEM when the user interacts with the TextField.
 
Methods inherited from class moka.x.CaptionedComponent
finalize
 
Methods inherited from class moka.x.Component
bottom, center, checkMnemonic, clean, eventTriggered, isCursorOver, left, move, onPaint, right, setBounds, setEnabled, setHeight, setMnemonic, setVisible, setWidth, setX, setY, toFront, top
 
Methods inherited from class moka.event.EventListener
eventTriggered
 
Methods inherited from class moka.lang.Object
equals, getClassName, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface moka.x.Captioned
setCaption, setFont
 

Field Detail

NO_INPUT_TYPE

public static final short NO_INPUT_TYPE
The TextField accepts any character.

See Also:
Constant Field Values

INT_INPUT_TYPE

public static final short INT_INPUT_TYPE
The TextField only accepts integers.

See Also:
Constant Field Values

FLOAT_INPUT_TYPE

public static final short FLOAT_INPUT_TYPE
The TextField only accepts integers and floats.

See Also:
Constant Field Values

CHAR_INPUT_TYPE

public static final short CHAR_INPUT_TYPE
The TextField only accepts characters.

See Also:
Constant Field Values

maxLength

public short maxLength
The number of character this TextField should accept. Should be > 0.


inputType

public short inputType
The input type of this TextField


mask

public char mask
The mask for this TextField. '\0' (default) to disable. Should be only read.

Constructor Detail

TextField

public TextField()

TextField

public TextField(java.lang.String caption)
Method Detail

paint

public void paint()
Paints the textfield.

Overrides:
paint in class Component

use

public void use()
This method is invoked by the GEM when the user interacts with the TextField.

Overrides:
use in class Component

setMask

public void setMask(char mask)
Sets the mask of the TextField. Set to '\0' to disable mask.

Parameters:
mask - The mask of the TextField.