|
Palm API Beta 2 |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.kjava.TextField
This class provides a simple TextField. It creates a thread for the caret to blink, accepts key input (including delete and backspace) and allows for only upper case entry. At present there is no support for Pen selection at all. It needs to be used in conjunction with a Spotlet, as this class does not extend Spotlet and therefore has no event handling itself. You need to get the Spotlet keyDown() method to call this class's handleKeyDown() method. After construction, to get the field "working" call setFocus() this will start the caret. Call loseFocus() to stop the caret when it's all over. *
Constructor Summary | |
TextField(java.lang.String ttext,
int x,
int y,
int w,
int h)
Create a new TextField |
Method Summary | |
java.lang.String |
getText()
Gets the text entered into the textfield |
void |
handleKeyDown(int key)
Should be called by Spotlet.keyDown(). |
boolean |
hasFocus()
Returns whether or not the textfield has focus |
void |
killCaret()
Stops the caret thread. |
void |
loseFocus()
Stops the caret blinking. |
void |
paint()
|
boolean |
pressed(int x,
int y)
Returns whether or not the x,y position is inside the textfield |
void |
setFocus()
Give the textfield "focus". |
void |
setText(java.lang.String txt)
Sets the text in the textfield. |
void |
setUpperCase(boolean flag)
Set whether or not the textfield should convert everything to upper case |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public TextField(java.lang.String ttext, int x, int y, int w, int h)
ttext
- The title (label) for the text fieldx
- x position (upper left)y
- y position (upper left)w
- width (including label)h
- heightMethod Detail |
public void setUpperCase(boolean flag)
flag
- if true then convert chars to upper casepublic void paint()
public void killCaret()
public void setFocus()
public void loseFocus()
setFocus()
public void setText(java.lang.String txt)
public java.lang.String getText()
public boolean hasFocus()
setFocus()
,
loseFocus()
public boolean pressed(int x, int y)
setFocus()
,
loseFocus()
public void handleKeyDown(int key)
|
Submit a bug or feature The GUI classes provided with this release are NOT part of CLDC, and they will be removed in later releases of this software. Official GUI classes for Java 2 Micro Edition will be defined separately through the Java Community Process and included in J2ME profiles. Java is 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. |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |