swing中addActionListener里面的方法有哪些?

解决方案 »

  1.   

           JButton b= new JButton();
            b.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    
                }
            });
    可以这么写
      

  2.   

    呵呵 谢谢你们 不是还有吗?就一个 public void actionPerformed(ActionEvent e) {
        
      }
    方法吗?
      

  3.   

    java.awt.event 
    接口 ActionListener
    这个接口只有一个方法。
    方法详细信息 
    actionPerformed
    void actionPerformed(ActionEvent e)发生操作时调用。 ////////////KeyListener里面有三个方法,你以后要用到的:
    java.awt.event 
    接口 KeyListener
    方法摘要 
     void keyPressed(KeyEvent e) 
              按下某个键时调用此方法。 
     void keyReleased(KeyEvent e) 
              释放某个键时调用此方法。 
     void keyTyped(KeyEvent e) 
              键入某个键时调用此方法。