Code example for PropertyChangeEvent

Methods: getNewValuegetOldValuegetPropertyNamegetSource

     * Logs the change 
     * @param evt - a property change event for the sickLeaveHours or vacationHours property 
    public void propertyChange(PropertyChangeEvent evt) {
        String propName = evt.getPropertyName();
        int oldValue = (Integer) evt.getOldValue();
        int newValue = (Integer) evt.getNewValue();
        Consultant consultant = (Consultant) evt.getSource();
                String.format("%s changed from %d to %d for %s",
                        propName, oldValue, newValue, consultant.getName()));
Contextual code suggestions in your IDE  Get Codota for Java