Code example for PropertyChangeListener

Methods: propertyChange

0
    public void propertyChange(PropertyChangeEvent evt) {
        PropertyChangeListener listener = (PropertyChangeListener) listenerRef.get();
        if (listener == null) {
            removeListener(); 
        } else { 
            listener.propertyChange(evt);
        } 
    } 
 
    private void removeListener() { 
        try { 
            Method method = src.getClass().getMethod("removePropertyChangeListener",
                    new Class[]{PropertyChangeListener.class});
            method.invoke(src, new Object[]{this});
        } catch (Exception e) {
            e.printStackTrace();
        } 
    } 
}