javax.swing.JPopupMenu#removePopupMenuListener ( )源码实例Demo

下面列出了javax.swing.JPopupMenu#removePopupMenuListener ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: netbeans   文件: OutputTab.java
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
    JPopupMenu popup = (JPopupMenu) e.getSource();
    popup.removeAll();
    popup.setInvoker(null);
    // hack
    KeyStroke esc = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
    JComponent c = getOutputPane().getTextView();
    c.getInputMap().put(esc, handle);
    getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(esc, handle);

    //hack end
    popup.removePopupMenuListener(this);
    for (TabAction action : popupItems) {
        action.clearListeners();
    }
}
 
源代码2 项目: rapidminer-studio   文件: DropDownPopupButton.java
@Override
public void popupMenuWillBecomeInvisible(final PopupMenuEvent e) {
	lastPopupCloseTime = System.currentTimeMillis();
	JPopupMenu jPopupMenu = (JPopupMenu) e.getSource();
	jPopupMenu.removePopupMenuListener(this);

	for (PopupMenuListener otherListener : otherListeners) {
		jPopupMenu.removePopupMenuListener(otherListener);
	}

}