public void removeAction(String category,Action action){
  JMenu categoryMenu=categories.get(getCaption(category));
  if (categoryMenu == null) {
    return;
  }
  for (int i=0; i < categoryMenu.getItemCount(); i++) {
    JMenuItem item=categoryMenu.getItem(i);
    if (item.getAction() == action) {
      categoryMenu.remove(i);
      return;
    }
  }
}

public void removeAction ( String category , Action action ) { JMenu categoryMenu = categories . get ( getCaption ( category ) ) ; if ( categoryMenu == null ) { return ; } for ( int i = 0 ; i < categoryMenu . getItemCount ( ) ; i ++ ) { JMenuItem item = categoryMenu . getItem ( i ) ; if ( item . getAction ( ) == action ) { categoryMenu . remove ( i ) ; return ; } } }
removes an action from a category .
