首页 > Windows开发 > 详细

e606. Determining Which Component or Window Has the Focus

时间:2018-09-06 10:13:24      阅读:113      评论:0      收藏:0      [点我收藏+]
    // 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

原文:https://www.cnblogs.com/borter/p/9596084.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!