找回密码
 立即注册
相关推荐换一批
  1. GB/T 2526-2020 氧化钆
  2. GB/T 39292-2020 废钯炭分析用取样和制样方法
  3. SN/T 0873-2000 进出口陶瓷铅、镉溶出量快速检验法
  4. GB/T 229-2020 金属材料 夏比摆锤冲击试验方法
  5. SN/T 0848-2000 进出口骨肉粉中磷的测定方法
  6. SN/T 0486.2-95 出口蛭石检验方法线膨胀倍数快速检验方法(回归分析法)
  7. SN/T 0487-95 进出口铜精矿化学分析方法碘量法测定铜量
  8. SN/T 1033-2002 出口松籽油检验方法
  9. HG/T 4767.1-2014 颜料和体质颜料塑料加工过程中颜色热稳定性的试验 第1部分:总则
  10. SN/T 3081.2-2012 出口烟花爆竹产品检验方法第2部分:电子点火头测定方法
  11. SN/T 3056.6-2011 烟花爆竹用化工原材料关键指标的测定第6部分:硫酸锶
  12. SN/T 3056.15-2011 烟花爆竹用化工原材料关键指标的测定第15部分:重铬酸钾
  13. SN/T 3056.10-2011 烟花爆竹用化工原材料关键指标的测定 第10部分:碳酸锶
  14. SN/T 3056.13-2011 烟花爆竹用化工原材料关键指标的测定第13部分:硝酸银
  15. SN/T 3056.5-2011 烟花爆竹用化工原材料关键指标的测定第5部分:硫磺
  16. SN/T 3056.8-2011 烟花爆竹用化工原材料关键指标的测定第8部分:氯酸钾
  17. SN/T 3056.9-2011 烟花爆竹用化工原材料关键指标的测定第9部分:碳酸氢钠
  18. SN/T 3056.2-2011 烟花爆竹用化工原材料关键指标的测定第2部分:氟硅酸钠
  19. SN/T 3056.4-2011 烟花爆竹用化工原材料关键指标的测定 第4部分:碱式碳酸铜
  20. SN/T 3056.1-2011 烟花爆竹用化工原材料关键指标的测定第1部分:苯二甲酸氢钾
  21. SN/T 3056.3-2011 烟花爆竹用化工原材料关键指标的测定 第3部分:红丹
  22. SN/T 3056. 12-2011 烟花爆竹用化工原材料关键指标的测定 第12部分:硝酸钡
  23. GB/T 31409-2015 船舶防污漆总铜含量测定法
方法thegetKeyCodekeyTyped | 手机短信编程 2022-09-28 164 0star收藏 版权: . 保留作者信息 . 禁止商业使用 . 禁止修改作品
1.KeyEvent类还有两个方法也常常被用到,那就是getKeyCode()与getKeyModifiersText(intmodifiers).键盘上每一个按钮都有对应码(Code),可用来查知用户按了啥键,如[Shift]键code为16。使用getKeyCode()方法就可以得知这个码,不过读者要注意,这个方法在keyTyped()上是无法检测出来的,由于keyTyped()只管用户输入的字符,而不会管到键盘的对应码,算是管理比较高层事情的方法。也就是说keyTyped()方法是keyboadindependent,由于不一样的键盘可能有不一样的对应码(如WindowsU.S.keyboard与windowsFrenchkeyboard就有不一样的对应码)。因而你必定要将getKeyCode()方法写在keyPressed()或keyReleased()方法中才会有效,由于这两个方法是管理比较低层的方法。
JAVA_精通swing程序设计.chm

(1. There are also two methods in the KeyEvent class that are often used, namely getKeyCode() and getKeyModifiersText(intmodifiers). Each button on the keyboard has a corresponding code (Code), which can be used to find out what key the user has pressed, such as The [Shift] key code is 16. This code can be obtained by using the getKeyCode() method, but the reader should note that this method cannot be detected on keyTyped(), because keyTyped() only cares about the characters entered by the user, but not the corresponding code of the keyboard. It's a way to manage things at a higher level. That is to say, the keyTyped() method is keyboadindependent, because different keyboards may have different corresponding codes (for example, WindowsU.S.keyboard and windowsFrenchkeyboard have different corresponding codes). Therefore, you must write the getKeyCode() method in the keyPressed() or keyReleased() method to be effective, because these two methods are relatively low-level management methods.
JAVA_Proficient in swing programming.chm)

[下载]11183317835.rar




上一篇:MyEclipse优化.pdf
下一篇:freemarker入门讲解