日期:2014-05-20 浏览次数:20682 次
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
public final class XBean {
private final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
private String site = "www.csdn.net";
private boolean validated = true;
private int amount = 100;
private double price = 0.01;
public XBean() {
}
public final String getSite() {
return site;
}
public final void setSite(final String site) {
pcs.firePropertyChange("site", getSite(), site);
this.site = site;
}
public final boolean isValidated() {
return validated;
}
public final void setValidated(final boolean validated) {
pcs.firePropertyChange("validate", isValidated(), validated);
this.validated = validated;
}
public final int getAmount() {
return amount;
}
public final void setAmount(final int amount) {
pcs.firePropertyChange("amount", getAmount(), amount);
this.amount = amount;
}