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 等. ...
随机推荐
- 升级java编译器
[Help]-[Eclipse Markerplace],搜索“Java 8”,安装插件.
- pandas数组(pandas Series)-(1)
导入pandas import pandas as pd countries = ['Albania', 'Algeria', 'Andorra', 'Angola', 'Antigua and Ba ...
- redhat 6、7配置yum源
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo # sed -i ' ...
- C#对Sql Server TEXT字段存储的实现(使用存储过程)
1.这里先准备数据库:在数据库中建立一个News数据表,字段为id,title,content2.建立用于插入news的存储过程:NewsInsert和NewsUpdate,代码如下: ),@cont ...
- 未能为数据库 '*'中得对象'*'分配空间,因文件组'PRIMARY'已满
服务器使用mssqlserver2005,最近经常出现无法新增信息错误,查看日志,发现严重错误提示,内容大致为: 无法为数据库 'weixin_main' 中的对象 'dbo.wx_logs'.'PK ...
- javascript基础拾遗(六)
1.Date内置对象 获取系统时间 var now = new Date() console.log(now) console.log(now.getDate()) console.log(now.g ...
- FIDDLER的使用方法及技巧总结(连载四)FIDDLER通用规则更改
四.FIDDLER通用规则更改 To make custom changes to web requests and responses, use FiddlerScript to add rules ...
- Python 操作redis 常用方法
Python 操作redis 1.字符串 #!/usr/bin/env python # -*- coding:utf-8 -*- import redis # python 操作str class ...
- Orcale11g单机安装与卸载
前言:本篇主要介绍Oracle11g企业版安装的准备工作,建议使用图形化界面安装,静默安装出现问题较多,初学者不好排查,本篇只给出关键步骤,最后介绍完全删除Orcale方法: Oracle Datab ...
- fzu2157(树形dp)
http://acm.fzu.edu.cn/problem.php?pid=2157 这是一道很水的树形dp吧,本来不想写它的题解的,不过比赛的时候,队友说要我做这个题目,但是由于我感觉另一个题目可以 ...