kooyee ‘s blog

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

          [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 事件在文字改變后觸發


          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 得到的是改變前的文字
          主站蜘蛛池模板: 长寿区| 长宁区| 常德市| 耿马| 墨玉县| 化隆| 来安县| 前郭尔| 鄢陵县| 五大连池市| 长岭县| 阳山县| 屯留县| 绍兴市| 高州市| 潮州市| 黄冈市| 安阳县| 贵阳市| 临澧县| 镇江市| 滕州市| 商城县| 龙游县| 定襄县| 西安市| 汶川县| 永顺县| 涿鹿县| 平罗县| 阳新县| 喀喇沁旗| 博乐市| 景洪市| 怀化市| 马尔康县| 奈曼旗| 衡东县| 陕西省| 玉门市| 东光县|