// 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. JavaScript 记录页面停留时间-通过测试

    <html> <head> <meta http-equiv="Content-Type" content="text/html; char ...

  2. 每日英语:China Pipeline Explosions Kill 52

    BEIJING—The death toll from a pair of oil pipeline explosions on Friday in the eastern China port ci ...

  3. 【硅谷问道】 WWDC 17: 开发者的最初观感

    [硅谷问道] WWDC 17: 开发者的最初观感 前言 每年的 WWDC 都是 iOS 开发者集体高潮的时刻.第一天的 WWDC 带来了全新的 iOS 11.MacOS.tvOS 和 watchOS, ...

  4. Android 编程下代码之(QQ消息列表滑动删除)

       这份代码写出来有些时候了,一直没共享,现在把它共享给大家.简单列一下代码中你可以学到的知识点: 自定义控件的实现方式: 事件的拦截分发消费机制: QQ会话列表滑动删除原理: 最后附上源码链接:Q ...

  5. 【转】解决Lost connection to MySQL server during query错误方法

    初步判断是MySQL可能挂掉了,在系统服务里面查看MySQL的进程并没有停止. 最开始考虑是数据库结构不对,但是我是通过Navicat for MySQL的备份和恢复备份导入数据,应该表结构都在备份文 ...

  6. Excel中功能清单转Project任务

    接:http://www.cnblogs.com/vipsoft/p/8495220.html 1.在E列输入公式: =IF(LEN(A2)>1,1,IF(LEN(B2)>1,2,IF(L ...

  7. 【转】mybatis连接Oracle做增删改查

    原文地址:http://blog.csdn.net/liumengcheng/article/details/34422475 入门请看http://blog.csdn.NET/liumengchen ...

  8. You have not concluded your merge (MERGE_HEAD exists) git拉取失败

    本文转自:http://yijiebuyi.com/blog/5b55eb51ad49ce41e2de9c85dd4513ca.html 今天获取git线上仓库代码报了这个错误: zhangzhi@m ...

  9. android中LayoutParams设置参数的理解

    1. 有这样的一个应用场景:有一个linearLayout控件在其中布局一个textView控件 首先,创建线性布局对象 LinearLayout layout = new LinearLayout( ...

  10. <Effective Django>读书笔记

    In Django parlance, a project is the final product, and it assembles one or more applications togeth ...