找回密码
 立即注册
相关推荐换一批
  1. 小学二年级英语下学期期末综合复习检测卷及参考答案
  2. GB/T 17603-1998 光解性塑料户外暴露试验方法
  3. GB/T 17548-1998 信息技术 POSIX 依从性的测试方法
  4. GB/T 17518-1998 化工产品中硅含量测定的通用方法还原硅钼酸盐分光光度法
  5. GB/T 17431.2-1998 轻集料及其试验方法 第2部分:轻集料试验方法
  6. GB 13917.8-1992 农药登记卫生用杀虫剂室内药效试验方法 模拟现场药效测定方法
  7. GB 13917.2-1992 农药登记卫生用杀虫剂室内药效试验方法 气雾剂的室内药效测定方法
  8. GB 13917.1-1992 农药登记卫生用杀虫剂室内药效试验方法 喷射剂的室内药效测定方法
  9. GB/T 17280-1998 原油蒸馏标准试验方法
  10. GB/T 17042-1997 航空轮胎胎圈耐高温试验方法
  11. GB/T 16886.10-2000 医疗器械生物学评价 第10部分:刺激与致敏试验
  12. GB/T 16860-1997 感官分析方法 质地剖面检验
  13. GB/T 16850.7-2001 光纤放大器试验方法基本规范 第7部分:外带插入损耗的试验方法
  14. GB/T 16850.5-2001 光纤放大器试验方法基本规范 第5部分:反射参数的实验方法
  15. GB/T 16850.3-1999 光纤放大器试验方法基本规范 第3部分:噪声参数的试验方法
  16. GB/T 16850.2-1999 光纤放大器试验方法基本规范 第2部分:功率参数的试验方法
  17. GB/T 16850.1-1997 光纤放大器试验方法基本规范 第1部分:增益参数的试验方法
  18. GB/T 16822-1997 介电晶体介电性能的试验方法
  19. GB/T 16701.1-1996 热电偶材料试验方法 第1部分:贵金属热电偶丝热电动势测量方法
  20. GB/T 16659-1996 煤中汞的测定方法
  21. GB/T 16658-1996 煤中铬、镉、铅的测定方法
  22. GB/T 16613-1996 试验用聚氯乙烯(PVC)糊的制备 分散器法
  23. GB/T 16600-1996 钨的发射光谱分析方法
  24. GB/T 16599-1996 钼的发射光谱分析方法
方法thegetKeyCodekeyTyped | 手机短信编程 2022-09-28 256 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入门讲解