e613. Modifying the Focus Traversal Order
JFrame frame = new JFrame();
JButton component1 = new JButton("1");
JButton component2 = new JButton("2");
JButton component3 = new JButton("3"); // By default, the focus traversal order is the same as the insertion order
frame.getContentPane().setLayout(new FlowLayout());
frame.getContentPane().add(component1);
frame.getContentPane().add(component2);
frame.getContentPane().add(component3); // Change the order from 1,2,3 to 1,3,2
component1.setNextFocusableComponent(component3);
component3.setNextFocusableComponent(component2);
component2.setNextFocusableComponent(component1); // Restore the order to 1,2,3
component1.setNextFocusableComponent(null);
component2.setNextFocusableComponent(null);
component3.setNextFocusableComponent(null);
| Related Examples |
e613. Modifying the Focus Traversal Order的更多相关文章
- 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 c ...
- 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 ...
- UI Framework-1: Aura Focus and Activation
Focus and Activation Focus and Activation are closely related. Definitions Focused window - this i ...
- 开发一个Swing功能时的一点总结
对JTextField进行效验,有两个途径:(1)是使用javax.swing.InputVerifier在获取焦点时进行校验(2)在点击“确定”按钮的监听事件中对控件的值进行校验 鉴于涉及的业务比较 ...
- 2.5 – Garbage Collection 自动垃圾回收 Stop-the-world vs. incremental vs. concurrent 垃圾回收策略
2.5 – Garbage Collection 自动垃圾回收 Lua 5.3 Reference Manual http://www.lua.org/manual/5.3/manual.html# ...
- LinkedBlockingQueueE(示例,出错代码)
java.util.concurrent 类 LinkedBlockingQueue<E> java.lang.Object java.util.AbstractCollection< ...
- Java多线程系列--“JUC集合”07之 ArrayBlockingQueue
概要 本章对Java.util.concurrent包中的ArrayBlockingQueue类进行详细的介绍.内容包括:ArrayBlockingQueue介绍ArrayBlockingQueue原 ...
- Java多线程系列--“JUC集合”08之 LinkedBlockingQueue
概要 本章介绍JUC包中的LinkedBlockingQueue.内容包括:LinkedBlockingQueue介绍LinkedBlockingQueue原理和数据结构LinkedBlockingQ ...
- Java多线程系列--“JUC集合”09之 LinkedBlockingDeque
概要 本章介绍JUC包中的LinkedBlockingDeque.内容包括:LinkedBlockingDeque介绍LinkedBlockingDeque原理和数据结构LinkedBlockingD ...
随机推荐
- pandas数组(pandas Series)-(3)向量化运算
这篇介绍下有index索引的pandas Series是如何进行向量化运算的: 1. index索引数组相同: s1 = pd.Series([1, 2, 3, 4], index=['a', 'b' ...
- Mac终端中主机名与用户名的修改
Mac终端的主机名称+用户名全部显示出来的话会可能显得特别长,影响整体美观,可以切换至root用户后 修改.bashrc文件进行格式化. 1. 终端中切换root用户 su - root 2. 修改/ ...
- Solr实现 并集式、多值、复杂 过滤查询的权限【转】
公司开发使用的搜索引擎核心是Solr,但是应为业务原因,需要相对复杂权限机制. 1)通过Solr的filterQuery可以实现field过滤,实现过滤项的效果.索引A{filter1:a,field ...
- vs code 快捷键的使用
vs code 快捷键的使用 shift + f12 快速查找函数的生成Ctrl+F12 查看单个函数的定义Shift+F12 查看所有函数的定义ctrl + ` 是打开运行的程序ctrl + Tab ...
- Oracle中TO_DATE TO_CHAR格式
TO_CHAR 是把日期或数字转换为字符串 TO_DATE 是把字符串转换为数据库中得日期类型转换函数 TO_NUMBER 将字符转化为数字 TO_CHAR 使用TO_CHAR函数处理数字 TO_CH ...
- JSP_运维_JSP项目部署到server(适合0经验新手)
实战:真正server端部署jsp项目经验总结与记录(完整过程从0到10适合对server端部署0经验新手) jsp+tomcat+mysql项目部署到真正server; servermysql安装; ...
- JMX超详细解读<转>
一.JMX的定义 JMX(Java Management Extensions)是一个为应用程序植入管理功能的框架.JMX是一套标准的代理和服务,实际上,用户可以在任何Java应用程序中使用这些代理和 ...
- Badboy+Jmeter进行性能测试
摸索了两天,终于搞定! 目的:使用Badboy和Jmeter添加5000个系统用户 一开始用Badboy进行批量添加,想先在excel中准备好5000个用户名,再导入到Badboy中.但是一直不成功, ...
- JDBC-批处理操作
javaweb学习总结(三十六)——使用JDBC进行批处理 在实际的项目开发中,有时候需要向数据库发送一批SQL语句执行,这时应避免向数据库一条条的发送执行,而应采用JDBC的批处理机制,以提升执行效 ...
- BFS-广度优先遍历
#include <iostream> #include <queue> using namespace std; /* 5 4 0 0 1 0 0 0 0 0 0 0 1 0 ...