javax.swing.JMenuItem.removeActionListener()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中javax.swing.JMenuItem.removeActionListener()方法的一些代码示例,展示了JMenuItem.removeActionListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenuItem.removeActionListener()方法的具体详情如下:
包路径:javax.swing.JMenuItem
类名称:JMenuItem
方法名:removeActionListener

JMenuItem.removeActionListener介绍

暂无

代码示例

代码示例来源:origin: runelite/runelite

void setFavoriteMenu(boolean favorite)
{
  String favoriteAction = favorite ?
    "Remove " + world.getId() + " from favorites" :
    "Add " + world.getId() + " to favorites";
  favoriteMenuOption.setText(favoriteAction);
  for (ActionListener listener : favoriteMenuOption.getActionListeners())
  {
    favoriteMenuOption.removeActionListener(listener);
  }
  favoriteMenuOption.addActionListener(e ->
  {
    onFavorite.accept(world, !favorite);
  });
}

代码示例来源:origin: apache/pdfbox

private void removeActionListeners(JMenuItem menuItem)
{
  for (ActionListener listener : menuItem.getActionListeners())
  {
    menuItem.removeActionListener(listener);
  }
}

代码示例来源:origin: apache/pdfbox

public void removeMenuListeners(PDFDebugger frame)
  {
    frame.getFindMenu().setEnabled(false);
    frame.getFindMenuItem().removeActionListener(findAction);
    frame.getFindNextMenuItem().removeActionListener(nextAction);
    frame.getFindPreviousMenuItem().removeActionListener(previousAction);
  }
}

代码示例来源:origin: apache/pdfbox

@Override
public void ancestorRemoved(AncestorEvent ancestorEvent)
{
  boolean isFirstEntrySkipped = false;
  zoomMenu.setEnableMenu(false);
  rotationMenu.setEnableMenu(false);
  
  JMenu menuInstance = viewMenu.getMenu();
  int itemCount = menuInstance.getItemCount();
  
  for (int i = 0; i< itemCount; i++)
  {
    JMenuItem item = menuInstance.getItem(i);
    // skip the first JMenuItem as this shall always be shown
    if (item != null)
    {
      if (!isFirstEntrySkipped)
      {
        isFirstEntrySkipped = true;
      }
      else
      {
        item.setEnabled(false);
        item.removeActionListener(this);
      }
    }
  }
}

代码示例来源:origin: stackoverflow.com

class MyInternalFrame extends JInternalFrame implements ActionListener {
  ...

  void removeSelfAndDispose() {
    for(JMenuItem button : parent.getMenuItems())
      button.removeActionListener(this);
    dispose();
  }
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

public void removeActionListener( ActionListener listener ){
  if( item != null ){
    item.removeActionListener( listener );
  }
}

代码示例来源:origin: xyz.cofe/docking-frames-core

public void removeActionListener( ActionListener listener ){
  if( item != null ){
    item.removeActionListener( listener );
  }
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

public void removeActionListener( ActionListener listener ){
    item.removeActionListener( listener );
  }
}

代码示例来源:origin: jtrfp/terminal-recall

@Override
    public void run() {
    it.removeActionListener(proxy);
    }});
}//end if(!null)

代码示例来源:origin: xyz.cofe/docking-frames-core

public void removeActionListener( ActionListener listener ){
    item.removeActionListener( listener );
  }
}

代码示例来源:origin: xyz.cofe/docking-frames-common

public void removeActionListener( ActionListener listener ){
    item.removeActionListener( listener );
  }
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-common

public void removeActionListener( ActionListener listener ){
    item.removeActionListener( listener );
  }
}

代码示例来源:origin: xyz.cofe/docking-frames-core

public void removeActionListener( ActionListener listener ){
  item.removeActionListener( listener );
}

代码示例来源:origin: org.opentcs.thirdparty.dockingframes/docking-frames-core

@Override
public void unbind(){
  if( item != null ){
    item.removeActionListener( listener );
  }
  super.unbind();
}

代码示例来源:origin: xyz.cofe/docking-frames-core

@Override
public void unbind(){
  if( item != null ){
    item.removeActionListener( listener );
  }
  super.unbind();
}

代码示例来源:origin: omegat-org/omegat

private void removeAllQuickScriptActionListenersFrom(JMenuItem menu) {
  if (menu == null) {
    return;
  }
  for (ActionListener l: menu.getActionListeners()) {
    if (l instanceof QuickScriptActionListener) {
      menu.removeActionListener(l);
    }
  }
}

代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui

public void removeActionListener(ActionListener listener) {
  getMenuItem().removeActionListener(listener);
}

代码示例来源:origin: com.dorkbox/SystemTray

@Override
  public
  void run() {
    if (callback != null) {
      _native.removeActionListener(callback);
      callback = null;
    }
    parent._native.remove(_native);
    _native.removeAll();
  }
});

代码示例来源:origin: openpreserve/jhove

/** Invoked when the "Close" menu item is selected.
   *  Overrides the parent class's method to delete
   *  the window rather than hiding it. */
  @Override
  protected void closeFromMenu ()
  {
    super.closeFromMenu ();
    if (_closeAllItem != null) {
      _closeAllItem.removeActionListener (_closeAllListener);
    }
    dispose ();
  }
}

代码示例来源:origin: net.sf.ingenias/editor

public void removeExitAction() {
    WindowListener[] wls = this.getWindowListeners();
    for (WindowListener wl:wls){
      if (!(wl instanceof CheckChangesInFile))
        this.removeWindowListener(wl);
    }
    this.exit.removeActionListener(this.exit.getActionListeners()[0]);
    
  }
}

相关文章

JMenuItem类方法