e617. Determining the Opposite Component of a Focus Event
The opposite component is the other component affected in a focus event. Specifically, in a focus-lost event, the opposite component is the one gaining the focus. In a focus-gain event, the opposite component is the one losing the focus.
Sometimes the opposite component is null, which indicates that the component is in some other application.
component.addFocusListener(new MyFocusListener());
public class MyFocusListener extends FocusAdapter {
public void focusGained(FocusEvent evt) {
// The component that lost the focus
Component c = evt.getOppositeComponent();
}
public void focusLost(FocusEvent evt) {
// The component that gained the focus
Component c = evt.getOppositeComponent();
}
}
| Related Examples |
e617. Determining the Opposite Component of a Focus Event的更多相关文章
- [HTML5] Using the focus event to improve navigation accessibility (nextElementSibling)
For a menu item, when we tab onto it, we want this element get 'focus' event, so that the submenu wi ...
- e606. Determining Which Component or Window Has the Focus
// null is returned if none of the components in this application has the focus Component compFocusO ...
- e620. Activating a Keystroke When Any Component in the Window Has Focus
Normally, a keystroke registered to a component is activated when the component has the focus. This ...
- e616. Determining If a Focus Lost Is Temporary or Permanent
A temporary focus-lost event occurs if the focus moves to another window. It's temporary because the ...
- e621. Activating a Keystroke When Any Child Component Has Focus
Normally, a keystroke registered on a component is activated when the component has the focus. This ...
- e614. Setting the Initial Focused Component in a Window
There is no straightforward way to set the initial focused component in a window. The typical method ...
- 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 ...
- e615. Finding the Next Focusable Component
public Component findNextFocus() { // Find focus owner Component c = KeyboardFocusManager.getCurrent ...
- salesforce lightning零基础学习(四) 事件(component events)简单介绍
lightning component基于事件驱动模型来处理用户界面的交互.这种事件驱动模型和js的事件驱动模型也很相似,可以简单的理解成四部分: 1.事件源:产生事件的地方,可以是页面中的输入框,按 ...
随机推荐
- 灾备系统的评判指标:RTO、RPO
RTO(RecoveryTime Object)是指灾难发生后,从IT系统崩溃导致业务停顿之刻开始,到IT系统恢复至可以支持各部门运作,业务恢复运营之时,此两点之间的时间段称为RTO. RPO(Rec ...
- Android 微信支付资料收集
老板要求支持微信支付,收集了些资料做后期参考 http://www.360doc.com/content/15/0214/10/7044580_448519997.shtml http://www.t ...
- android开发图片分辨率
一直受到android开发图片分辨率问题困扰.drawable-(xdpi,hdpi,mdpi,ldpi,nodpi)这几个文件夹到底怎么放图片呢? dpi是什么呢? dpi是“dot per inc ...
- VS生成后事件对文件的copy以及更换扩展名
在VC++2012的项目里,属性内有生成事件. 可以用后期生成事件命令行做一些生成之后的事情,比如对编译出的.dll,.lib,.pdb等文件进行copy或者更改扩展名. 我用到的就是将和项目同名的. ...
- Python爬取中国票房网所有电影片名和演员名字,爬取齐鲁网大陆所有电视剧名称
爬取CBO中国票房网所有电影片名和演员名字 # -*- coding: utf-8 -*- # 爬取CBO中国票房网所有电影片名 import json import requests import ...
- Mac git pull失败,最新操作系统导致 SSH issues with Mac OS X High Sierra
Mac 升级到最新操作系统ssh加密方式和gitlub不一样,导致不能git pull 如:mac是md5加密方式,gitlut是aes-256-cbc加密方式 解决方法如下 A coworker ...
- pandas的连接函数concat()函数
pd.concat(objs, axis=0, join='outer', join_axes=None, ignore_index=False, keys=None, levels=No ...
- splitter 使用
splitter1.Width = ; splitter1.Height = ; Label l = new Label(); l.Text = "···"; //写入的字,具体指 ...
- 基于jQuery点击图像居中放大插件Zoom
分享一款基于jQuery点击图像居中放大插件Zoom是一款放大的时候会从原图像的位置以动画方式放大到画面中间,支持点击图像或者按ESC键来关闭效果.效果图如下: 在线预览 源码下载 实现的代码. ...
- laravel iis搭建
1.urlrewrite https://www.iis.net/downloads/microsoft/url-rewrite 2.安装phpmanager 3.目录定位到public 赋给iuse ...