摘要: //省略代码 } 代码说明: 这个JavaBean除了为属性添加的setXXX()方法与getXXX()方法之外,还定义了两个事件方法,从这两个方法命名可以看出,这个JavaBean处理
……//省略代码
}
代码说明:
这个JavaBean除了为属性添加的setXXX()方法与getXXX()方法之外,还定义了两个事件方法,从这两个方法命名可以看出,这个JavaBean处理的事件为ActiveEvent事件。分别为添加监听方法与删除监听方法。
完整代码:
com\wsy\visalJavaBean.java完整代码:
package com.wsy;
import java.awt.event.ActionListener;
public class visalJavaBean {
private int color;
private int background;
private int active;
public int getActive() {
return active;
}
public void setActive(int active) {
this.active = active;
}
public int getBackground() {
return background;
}
public void setBackground(int background) {
this.background = background;
}
public int getColor() {
return color;
}
public void setColor(int color) {
this.color = color;
}
public void addActionListener(ActionListener l){
}
public void removeActionListener(ActionListener l){
}
}

RSS订阅






