Code example for PropertyChangeSupport

Methods: addPropertyChangeListener

0
     * Add a PropertyChangeListener to the listener list. 
     * @param listener The listener to add. 
     */ 
    public void addPropertyChangeListener(PropertyChangeListener listener) {
        if ( propertyChangeSupport == null ) {
            propertyChangeSupport = new PropertyChangeSupport(this);
        } 
        propertyChangeSupport.addPropertyChangeListener(listener);
    } 
     
    /**  
     * Removes a PropertyChangeListener from the listener list. 
     * @param listener The listener to remove. 
     */ 
    public void removePropertyChangeListener(PropertyChangeListener listener) {
        if ( propertyChangeSupport != null ) {
            propertyChangeSupport.removePropertyChangeListener(listener);
        } 
    }