public class MyTextBox extends Canvas implements Runnable{
private final static int KEY_CLEAR = -8;
private final static int MAX_NUM = 10;
private final static int KEY_LEFT = -3;
private final static int KEY_RIGHT = -4;
private char[] m_text = new char[10];
private int currentCursor = 0;
private int previouseCursor = 0;
private int currentKey = -1;
private int keyStatus = 0;
private int offPos = 0;
private int currentLen = 0;
private boolean showCursor = true;
private int left;
private int top;
switch(keyCode){
case KEY_LEFT:
leftCursor();
break;
case KEY_RIGHT:
rightCursor();
break;
case KEY_CLEAR:
deleteChar();
break;
case KEY_NUM0:
case KEY_NUM1:
case KEY_NUM2:
case KEY_NUM3:
case KEY_NUM4:
case KEY_NUM5:
case KEY_NUM6:
case KEY_NUM7:
case KEY_NUM8:
case KEY_NUM9: