⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e617. determining the opposite component of a focus event.txt

📁 这里面包含了一百多个JAVA源文件
💻 TXT
字号:
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();
        }
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -