Posted on 2008-03-01 19:44
kooyee 阅读(458)
评论(0) 编辑 收藏 所属分类:
Swing/Applet
inputMethodTextChanged
事件在文字改变后触发
The text field fires three events: a key-pressed event, a key-typed event, and a key-released event.
Note :
the key-typed event doesn't have key code information. 含有key charactere信息
key-pressed and key-released events don't have key character information. 含有key code信息
用来检验text changed可以用key-released events. 因为它能够通过getText()得到textfield中改变后的text. 而 key-pressed event, key-typed event 得到的是改变前的文字