解决方案 »

  1.   

    To write an Action Listener, follow the steps given below:1、Declare an event handler class and specify that the class either implements an ActionListener interface or extends a class that implements an ActionListener interface. For example:
      public class MyClass implements ActionListener { 
    2、Register an instance of the event handler class as a listener on one or more components. For example:
      someComponent.addActionListener(instanceOfMyClass);
    3、Include code that implements the methods in listener interface. For example:
    public void actionPerformed(ActionEvent e) { 
        ...//code that reacts to the action... 
    }
    ===================================================================================
    至于你的情况,是缺少了addActionListener的方法调用。
    不防在NextCustomerJButton构造函数中加入:
    addActionListener(this);
      

  2.   

        树哥,感谢您的点拨!!
        请问树哥:
        您的方案,使用布局管理器解决问题.
        弟我已经在代码块1中的第61行处,进行了“布局管理器”:设置为BordLayout的边界布局了呀...?
        为什么还会有:
        不能够让“按钮变长”的问题被处理的场景出现呢?
        希望能够得到树哥的点拨!!