public abstract class FocusAdapter extends Object implements FocusListener
扩展这个类来创建一个FocusEvent
听众和覆盖感兴趣的事件的方法。(如果你实施FocusListener
接口,你必须定义所有的方法在这。这个抽象类定义了他们所有的空方法,所以你只能定义你关心的事件的方法。)
创建一个使用扩展类的听众对象然后登记与组件使用组件的addFocusListener
方法。当组件获得或丢失键盘焦点,在监听对象相关的方法被调用时,与FocusEvent
传递给它。
FocusEvent
,
FocusListener
,
Tutorial: Writing a Focus Listener
Constructor and Description |
---|
FocusAdapter() |
public void focusGained(FocusEvent e)
focusGained
接口
FocusListener
public void focusLost(FocusEvent e)
focusLost
接口
FocusListener
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.