List of usage examples for javax.swing JPopupMenu addFocusListener
public synchronized void addFocusListener(FocusListener l)
From source file:com.anrisoftware.prefdialog.miscswing.components.menu.PopupMenuComponent.java
/** * Sets the pop-up menu.//from w w w . j a va 2 s . c om * * @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); }