zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    理解java的接口和抽象类
    Yum 仓库配置
    Vsftp 服务配置
    SAMBA 服务配置
    DHCP 服务配置
    dd 命令的使用
    linux 账户控制
    CentOS 系统优化
    Page Cache与Page回写
    TCP拥塞控制
  • 原文地址:https://www.cnblogs.com/borter/p/9596099.html
Copyright © 2011-2022 走看看