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 等. ...
 
随机推荐
- 设置Sysctl.conf用以提高Linux的性能(最完整的sysctl.conf优化方案)
			
Sysctl是一个允许您改变正在运行中的Linux系统的接口.它包含一些 TCP/IP 堆栈和虚拟内存系统的高级选项, 这可以让有经验的管理员提高引人注目的系统性能.用sysctl可以读取设置超过五百 ...
 - MVC+EF+PagedList+调用通用存储封装+多表联合信息展示分页+存储过程分页
			
主要的技术点不在这里一一阐述,相关存储也是引用别人的,主要技术点就是通过最优性能方式处理需求,PagedList.包需要在线安装就可以 直接上干货 1.存储代码之第一种: 参数相对多点 /**//* ...
 - 【Linux技术】autotools制作makefile过程详解
			
Preface Makefile固然可以帮助make完成它的使命,但要承认的是,编写Makefile确实不是一件轻松的事,尤其对于一个较大的项目而言更是如此.那么,有没有一种轻松的手段生成Makefi ...
 - 使用canvas制作简单表格
			
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...
 - Android下基于PCM的音频渲染
			
环境准备 请按照我之前的文章-Android下基于SDL的位图渲染,安装必要的开发环境. 实践篇 这里主要参考Beginning SDL 2.0(6) 音频渲染及wav播放,只不过将源从WAV文件改成 ...
 - Centos7 ss搭建
			
1.安装pip Pip 是 Python 的包管理工具,下载ss十分方便,但是centos是没有pip的,我们需要安装一个. yum install python-setuptools & e ...
 - Python nose单元测试框架结合requests库进行web接口测试
			
[本文出自天外归云的博客园] 之前写过一篇关于nose使用方法的博客.最近在做一元乐购产品的接口测试,结合着python的requests库可以很方便的进行web接口测试并生成测试结果.接口测试脚本示 ...
 - Jenkins + Django 完整实战,细化到每一步操作
			
Reference: http://blog.csdn.net/GitChat/article/details/78271099?locationNum=3&fps=1 [不要错过文末彩蛋] ...
 - StringUtils.isEmpty和StringUtils.isBlank用法和区别
			
两个方法都是判断字符是否为空的.前者是要求没有任何字符,即str==null 或 str.length()==0:后者要求是空白字符,即无意义字符.其实isBlank判断的空字符是包括了isEmpty ...
 - xorm的sql builder
			
最近在使用xorm,并使用了sql builder来构建sql查询没想到升级后原来可以使用的代码居然报错了. 0x00 代码 sql, args, _ := builder.Select(" ...