e649. 处理焦点改变事件

    
component.addFocusListener(new MyFocusListener());
    
    public class MyFocusListener extends FocusAdapter {
        public void focusGained(FocusEvent evt) {
            // The component gained the focus
        }
        public void focusLost(FocusEvent evt) {
            // The component lost the focus
        }
    }

 

Related Examples
posted @ 2018-09-02 21:23  borter  阅读(214)  评论(0编辑  收藏  举报