e611. Setting Focus Traversal Keys for the Entire Application
This example changes the focus traversal keys for the entire application. For an example of how to change the focus traversal keys for a particular component, see e610 Setting Focus Traversal Keys in a Component.
// Change the forward focus traversal keys for the application
Set set = new HashSet(
KeyboardFocusManager.getCurrentKeyboardFocusManager().getDefaultFocusTraversalKeys(
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS));
set.clear(); // Call clear() if you want to eliminate the current key set
set.add(KeyStroke.getKeyStroke("F2"));
KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalKeys(
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set); // Change the backward focus traversal keys for the application
set = new HashSet(
KeyboardFocusManager.getCurrentKeyboardFocusManager().getDefaultFocusTraversalKeys(
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS));
set.clear(); // Call clear() if you want to eliminate the current key set
set.add(KeyStroke.getKeyStroke("F3"));
KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalKeys(
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, set); // Remove all forward and backward focus traversal keys for the application
set.clear();
KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalKeys(
KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, set);
KeyboardFocusManager.getCurrentKeyboardFocusManager().setDefaultFocusTraversalKeys(
KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, set);
| Related Examples |
e611. Setting Focus Traversal Keys for the Entire Application的更多相关文章
- e610. Setting Focus Traversal Keys in a Component
When the focus is on a component, any focus traversal keys set for that component override the defau ...
- e613. Modifying the Focus Traversal Order
JFrame frame = new JFrame(); JButton component1 = new JButton("1"); JButton component2 = n ...
- How to remove focus without setting focus to another control?
How to remove focus without setting focus to another control? Ask Question up vote 67 down vote favo ...
- e609. Listening to All Focus Changes Between Components in an Application
To listen to focus change events between components, install a listener with the keyboard focus mana ...
- How to exit the entire application from a Python thread?
If all your threads except the main ones are daemons, the best approach is generally thread.interrup ...
- 【移动端debug-4】iOS下setTimeout无法触发focus事件的解决方案
开篇总结:其实目前无法解决这个bug. 这两天做项目遇到了这个case,项目需求是打开页面的时候,input元素自动弹起键盘.由于各种方面的考虑,我们希望通过setTimeout延时200毫秒让inp ...
- UI Framework-1: Aura Focus and Activation
Focus and Activation Focus and Activation are closely related. Definitions Focused window - this i ...
- qt qml 类型之Keys
Keys 类是 Qt Quick 提供的,专门供 Item 处理按键事件的类.它定义了很多针对特定按键的信号,比如 onReturnPressed / onEscapePressed / onDown ...
- 关于redis的keys命令的性能问题
KEYS pattern 查找所有符合给定模式 pattern 的 key . KEYS * 匹配数据库中所有 key . KEYS h?llo 匹配 hello , hallo 和 hxllo 等. ...
随机推荐
- [Windows Azure] How to Manage Cloud Services
How to Manage Cloud Services To use this feature and other new Windows Azure capabilities, sign up f ...
- node的http请求
//node的http服务 'use strict' var http = require('http') var server = http.createServer(function (reque ...
- Oracle sql%rowcount 返回影响行数;sql server @@RowCount返回影响行数
sql server中,返回影响行数是:If @@RowCount<1 Oracle中,返回影响行数是:If sql%rowcount<1 例: sqlserver: create pro ...
- Python(九)之网络编程
一般的网络通信: Python中利用socket模块实现网络主机间通讯: socket.socket(family,type) family:套接字类型 AF_INET AF_UNIX type: S ...
- 备份Android机上的照片
[本文出自天外归云的博客园] 一年一度的春节放假开始了,今天收拾柜子发现了一台上大学时候用的android机,里面有几百张当年的回忆. 写了个shell脚本遍历了下照片存放的路径,然后用一个pytho ...
- s3c2440内存控制器与SDRAM基本测试
前面我们实验的LED和串口程序,是cpu发送地址给特定的寄存器,在寄存器中写相应的位,达到控制要求. 第一类是GPIO门电路如LED,第二类是协议类如串口,这些都不是cpu直接给地址信息,而是通过寄存 ...
- CentIOS PHP 扩展库
1.GD库 yum -y install php-gd
- JAVA-数据库之JDBC连接MySQL数据库
相关资料:<21天学通Java Web开发> JDBC连接MySQL数据库1.如果需要通过JDBC来连接MySQL数据库,还必须先在MySQL数据库服务器中创建数据库和表. Connect ...
- 手记:配置IIS服务器,支持sis、SISX、3GP、ADP、AMR、JAD、JAR、MMF、MFM、PMD、UMD等文件下载
发此博文原因是遇到一个 手机端读取服务器端.amr格式文件失败的例子. 反复测试发现从服务端无法播放,或下载.amr格式的文件.就想到可能是服务器站点托管服务 IIS不支持对.amr格式的解析,意 ...
- 【WPF】在MenuItem中下划线“_”显示不正常
MenuItem的Header显示文字时发现一个问题,字符串中的第一个下划线“_”不能显示.如果该下划线前面是一个英文字母,则下划线会跑到该字母下方.(是中文汉字则不会) 查到原因是第一个下划线“_” ...