点击but1的时候,可以触发事件吗?

解决方案 »

  1.   

    如果but2没有响应,你看看错误信息?我用的是jbuilder6,一般如果有错误,可以看到的。
      

  2.   

    but1.addActionListener(this);
    but1.addActionListener(this);
      

  3.   

    ActionCommand最好显式声明。
    but1。setActionCommand("1")~~~
      

  4.   

    最好用e.getActionCommand().equals("2")