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 等. ...
随机推荐
- Oracle根据表生成系统流水号
1.建表tablewater create table TABLEWATER ( tb_id INTEGER not null, vc_table_name ), num_water_no ) )vc ...
- ROC曲线(Receiver Operating Characteristic Curve)
分类模型尝试将各个实例(instance)划归到某个特定的类,而分类模型的结果一般是实数值,如逻辑回归,其结果是从0到1的实数值.这里就涉及到如何确定阈值(threshold value),使得模型结 ...
- Centos7.4使用SoftEther搭建V.PN
参考: https://blog.csdn.net/qq_39591494/article/details/78625394?locationNum=9&fps=1 https://www.b ...
- fastjson使用TypeReference示例
package junit.test; import java.util.ArrayList; import java.util.HashMap; import java.util.List; imp ...
- C#学习笔记(18)——C#构造函数中this和base的使用
说明(2017-7-21 10:29:44): 1. 关于构造函数里的this和base,在网上查了很多资料,但都没有讲的很清楚的,或者是能让我看懂的,感觉都是叽叽歪歪,罗里吧嗦,磨磨唧唧的,有的直接 ...
- 操作Excel文件--java
java操作Excel首先要导入 JExcelAPI JExcelAPI是一套纯粹使用JAVA开发出来的Excel表格操作组件,本身并不与特定的操作系统进行绑定,可以在不同的操作系统上对Excel文件 ...
- 【转】如何使用visual studio将你的程序打包成安装包
原文地址:https://www.cnblogs.com/SolarWings/p/6132310.html 很久很久以前,我一直有一个梦想,那就是做出一个自己的游戏,这个游戏很像模像样,除了拥有一个 ...
- 【微信小程序】Page页面跳转(路由/返回)并传参
页面跳转的方法参考官方文档: https://mp.weixin.qq.com/debug/wxadoc/dev/framework/app-service/route.html 问题:使用wx.na ...
- InstallShield安装jdk并设置环境变量
1. 检查是否安装jdk function OnBegin() begin Disable (BACKBUTTON); if(!MAINTENANCE)then SdLicense2 ("L ...
- Android指南 - 主题
译者注:theme(主题)和style(样式)是专用术语,下面对这两个词汇不在使用中文词汇. theme 是安卓的一种机制,用于为应用程序和activity提供一致的样式(style).样式s ...