ui/src/main/java/ucar/nc2/ui/widget/PopupMenu.java
public void addAction( String menuName, ImageIcon icon, Action act) {
    act.putValue( Action.NAME, menuName);
    act.putValue( Action.SMALL_ICON, icon);
    JMenuItem mi = add(act);
    mi.setHorizontalTextPosition( SwingConstants.LEFT );
  }
public void addAction( String menuName, ImageIcon icon, Action act) {
    act.putValue( Action.NAME, menuName);
    act.putValue( Action.SMALL_ICON, icon);
    JMenuItem mi = add(act);
    mi.setHorizontalTextPosition( SwingConstants.LEFT );
  }
public void addAction ( String menuName , ImageIcon icon , Action act ) { act . putValue ( Action . NAME , menuName ) ; act . putValue ( Action . SMALL_ICON , icon ) ; JMenuItem mi = add ( act ) ; mi . setHorizontalTextPosition ( SwingConstants . LEFT ) ; }
Add an action to the popup menu, with an icon.
Note that the menuName is made the NAME value of the action.
@param menuName name of the action on the menu.
@param act the Action.
Add an action to the popup menu with an icon . Note that the menuName is made the NAME value of the action .