kooyee ‘s blog

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

          [Text] 改變文字事件

          Posted on 2008-03-01 19:44 kooyee 閱讀(467) 評論(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 事件在文字改變后觸發(fā)


          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 得到的是改變前的文字
          主站蜘蛛池模板: 乌兰察布市| 德兴市| 通州区| 横峰县| 洪泽县| 克拉玛依市| 秦皇岛市| 石城县| 太白县| 新源县| 石狮市| 淄博市| 清流县| 吉水县| 蓬溪县| 察雅县| 荔波县| 龙川县| 夏邑县| 沾化县| 衡阳市| 铜陵市| 合水县| 台前县| 龙海市| 三都| 洪湖市| 阿图什市| 余庆县| 乐亭县| 衡山县| 安西县| 宁化县| 岳池县| 昌吉市| 淮滨县| 临沭县| 平凉市| 河南省| 安溪县| 义乌市|