监视键盘的动作,用usertf.addKeyListener(this);它的接口软件包是KeyListener,应该import java.awt.event.*; 必须重载的接口函数是
public void keyPressed(KeyEvent e){}
public void keyReleased(KeyEvent e){}
public void keyTyped(KeyEvent e){}
监视焦点的动作,用usertf.add FocusListener (this);它的接口软件包是FocusListener应该import java.awt.event.*; 必须重载的接口函数是
public void focusLost(FocusEvent e) { }