if(evt.getcommand().equals("此处填写菜单名")){}
试一下

解决方案 »

  1.   

    "if (evt.target == mnuFileOpen)"
    这个地方应该改为 if(evt.getActionCommand().equals("open(注:菜单名)")){}
      

  2.   

    一般地,除了比较基本数据类型可用==,其余(也就是对象)都用equals
    否则比较的是引用而不是内容
      

  3.   

    上面两种我都试过了,还是有问题
    cannot resolve symbol
    symbol  : method getActionCommand ()
    location: class java.awt.Event
                    if(evt.getActionCommand().equals("Open"))
    再请教,谢谢!                      ^