// null is returned if none of the components in this application has the focus
Component compFocusOwner =
KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); // null is returned if none of the windows in this application has the focus
Window windowFocusOwner =
KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow(); // Use this method to determine whether a particular component has the focus
boolean b = component.isFocusOwner();
Related Examples

e606. Determining Which Component or Window Has the Focus的更多相关文章

  1. 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 ...

  2. React.js Tutorial: React Component Lifecycle

    Introduction about React component lifecycle. 1 Lifecycle A React component in browser can be any of ...

  3. GNU General Public License v3.0

    Version 3, 29 June 2007       Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/& ...

  4. Styles and Themens(4)android自定义主题时可使用的属性

    A list of the standard attributes that you can use in themes can be found at R.styleable.Theme. Cons ...

  5. windows消息机制详解(转载)

    消息,就是指Windows发出的一个通知,告诉应用程序某个事情发生了.例如,单击鼠标.改变窗口尺寸.按下键盘上的一个键都会使Windows发送一个消息给应用程序.消息本身是作为一个记录传递给应用程序的 ...

  6. Deploying JRE (Native Plug-in) for Windows Clients in Oracle E-Business Suite Release 12 (文档 ID 393931.1)

    In This Document Section 1: Overview Section 2: Pre-Upgrade Steps Section 3: Upgrade and Configurati ...

  7. 所有CM_消息的说明

    这些CM消息,居然在Delphi的帮助里是没有任何说明的,真是昏倒.意外在高手的书里找到了所有说明,说明如下: Message Constant Value Description cm_Base $ ...

  8. CSharp设计模式读书笔记(10):装饰模式(学习难度:★★★☆☆,使用频率:★★★☆☆)

    装饰模式(Decorator Pattern): 动态地给一个对象增加一些额外的职责,就增加对象功能来说,装饰模式比生成子类实现更为灵活. 模式角色与结构: 示例代码: using System; u ...

  9. 设计模式的征途—10.装饰(Decorator)模式

    虽然目前房价依旧很高,就连我所在的成都郊区(非中心城区)的房价均价都早已破万,但却还是阻挡不了大家对新房的渴望和买房的热情.如果大家买的是清水房,那么无疑还有一项艰巨的任务在等着大家,那就是装修.对新 ...

随机推荐

  1. Python Pycharm连接Ubantu Python环境

    由于我习惯在window下开发,但是代码环境布局在Ubantu.使用Python,为了方便程序的调试,尝试在Windows下的Pycharm远程连接到Ubantu虚拟机下的Python环境. 1.准备 ...

  2. linux命令(45):去掉 所有文件中的空行

    方法一:利用grep grep -v '^\s*$' test.txt 注:-v表示将匹配的结果进行反转,正则表达式匹配空行.(空行可包括空格符制表符等空白字符) 方法二:利用sed sed '/^\ ...

  3. 【C/C++】一道试题,深入理解数组和指针

    在x86平台下分析下面的代码输出结果 int main(void) { ] = {, , , }; ); ); printf(], *ptr2); ; } &a+1 首先明确,a是一个具有4个 ...

  4. 【ARM】2410裸机系列-uart串口通信

    开发环境 (1)硬件平台:FS2410 (2)主机:Ubuntu 12.04 FS2410串口的原理图 串口UART寄存器配置   配置TXD0与RXD0(GPH2.GPH3) 设置波特率(UBRDI ...

  5. FIDDLER的使用方法及技巧总结(连载二)FIDDLER用户界面

    FIDDLER的使用方法及技巧总结 (接上篇内容~~) 二.FIDDLER用户界面 FIDDLER用户的几面主要包括下面几个部分,如图所示:首先FIDDLER窗口的最左边是web session列表, ...

  6. SQLite 入门教程一 基本控制台(终端)命令

    一.基本简介 SQLite 是一个自持的(self-contained).无服务器的.零配置的.事务型的关系型数据库引擎.因为他很小,所以也可以作为嵌入式数据库内建在你的应用程序中.SQLite 被应 ...

  7. iOS开发中多线程断点下载大文件

    主要思想,就是创建一个与目标文件等大小的空白文件,然后分段往这个空白文件中写入数据. 可以通过发送HEAD请求,获得服务器中文件的具体大小,然后再将这样的长度分割成若干等大的数据块,在发送get请求时 ...

  8. NSOperation和NSOperationQueue的一些基本操作

    当初学习多线程这一块的时候,时间比较匆忙,没有细细考虑,而今重新学一次,算是复习和总结吧. #import "ViewController.h" @interface ViewCo ...

  9. wcf会话、实例化、并发

    在asp.net中含有会话,是保存值,供所有的程序使用,同样在wcf中也有会话,供多个客户端使用. 会话的支持通常在契约定义的开始标出,如下 [ServiceContract(Namespace = ...

  10. Where-To-Put-The-Auto-Layout-Code(AutoLayout代码应该放在哪里?)

    Where-To-Put-The-Auto-Layout-Codehtml, body {overflow-x: initial !important;}html { font-size: 14px; ...