kooyee ‘s blog

          開源軟件, 眾人努力的結晶, 全人類的共同財富
          posts - 103, comments - 55, trackbacks - 0, articles - 66
             :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          [Text] 改變文字事件

          Posted on 2008-03-01 19:44 kooyee 閱讀(466) 評論(0)  編輯  收藏 所屬分類: Swing/Applet


          void caretPositionChanged(InputMethodEvent event)
                    This method is called when the cursor position within the text is changed.
           void inputMethodTextChanged(InputMethodEvent event)
                    This method is called when the text is changed.


          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 得到的是改變前的文字
          主站蜘蛛池模板: 饶平县| 长丰县| 盘山县| 成武县| 荆州市| 资溪县| 灵宝市| 柘城县| 金门县| 青神县| 土默特右旗| 汨罗市| 奈曼旗| 资兴市| 天镇县| 青岛市| 中山市| 冕宁县| 佛学| 正定县| 客服| 高雄县| 介休市| 城步| 佛学| 陆河县| 湖北省| 永春县| 泰来县| 安国市| 大冶市| 同德县| 平乐县| 林口县| 古丈县| 洪洞县| 南乐县| 革吉县| 府谷县| 苏尼特右旗| 阳江市|