public interface WindowFocusListener extends EventListener
WindowEvents监听器接口,包括
WINDOW_GAINED_FOCUS和
WINDOW_LOST_FOCUS事件。班级,在处理
WindowEvent兴趣实现这个接口(和所有的方法,它包含)或扩展摘要
WindowAdapter类(只覆盖方法的兴趣)。从这个类进行了注册一个
Window使用
Window的
addWindowFocusListener方法创建监听对象。当
Window的地位的变化,通过它被打开,关闭,启动,关闭,图标化,或deiconified美德,或焦点转移进入或离开的
Window,在监听对象相关的方法被调用时,与
WindowEvent传递给它。
WindowAdapter,
WindowEvent,
Tutorial: Writing a Window Listener
| Modifier and Type | Method and Description |
|---|---|
void |
windowGainedFocus(WindowEvent e)
当调用窗口设置为焦点窗口,这意味着窗口,或它的一部分,将接收键盘事件。
|
void |
windowLostFocus(WindowEvent e)
当调用窗口不再是焦点窗口,这意味着键盘事件将不再被传递到窗口或其任何部分。
|
void windowGainedFocus(WindowEvent e)
void windowLostFocus(WindowEvent e)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.