Example usage for javax.swing JPopupMenu removeFocusListener

List of usage examples for javax.swing JPopupMenu removeFocusListener

Introduction

In this page you can find the example usage for javax.swing JPopupMenu removeFocusListener.

Prototype

public synchronized void removeFocusListener(FocusListener l) 

Source Link

Document

Removes the specified focus listener so that it no longer receives focus events from this component.

Usage

From source file:com.anrisoftware.prefdialog.miscswing.components.menu.PopupMenuComponent.java

/**
 * Sets the pop-up menu./*from   w ww.j  a v a2  s .c o  m*/
 * 
 * @param menu
 *            the {@link JPopupMenu}.
 * 
 * @throws NullPointerException
 *             if the specified menu is {@code null}.
 */
public void setPopupMenu(JPopupMenu menu) {
    notNull(component);
    JPopupMenu oldValue = this.menu;
    this.menu = menu;
    if (oldValue != null) {
        oldValue.removeFocusListener(menuFocusListener);
    }
    menu.addFocusListener(menuFocusListener);
}