Package java.beans

Class PropertyChangeEvent

java.lang.Object
java.util.EventObject
java.beans.PropertyChangeEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
IndexedPropertyChangeEvent

public class PropertyChangeEvent
extends EventObject
An event that indicates that a constraint or a boundary of a property has changed.
See Also:
Serialized Form
  • Constructor Details

    • PropertyChangeEvent

      public PropertyChangeEvent​(Object source, String propertyName, Object oldValue, Object newValue)
      The constructor used to create a new PropertyChangeEvent.
      Parameters:
      source - the changed bean.
      propertyName - the changed property, or null to indicate an unspecified set of the properties has changed.
      oldValue - the previous value of the property, or null if the propertyName is null or the previous value is unknown.
      newValue - the new value of the property, or null if the propertyName is null or the new value is unknown.
  • Method Details

    • getPropertyName

      public String getPropertyName()
      Returns the name of the property that has changed. If an unspecified set of properties has changed it returns null.
      Returns:
      the name of the property that has changed, or null.
    • setPropagationId

      public void setPropagationId​(Object propagationId)
      Sets the propagationId object.
      See Also:
      getPropagationId()
    • getPropagationId

      public Object getPropagationId()
      Returns the propagationId object. This is reserved for future use. Beans 1.0 demands that a listener receiving this property and then sending its own PropertyChangeEvent sets the received propagationId on the new PropertyChangeEvent's propagationId field.
      Returns:
      the propagationId object.
    • getOldValue

      public Object getOldValue()
      Returns the old value that the property had. If the old value is unknown this method returns null.
      Returns:
      the old property value or null.
    • getNewValue

      public Object getNewValue()
      Returns the new value that the property now has. If the new value is unknown this method returns null.
      Returns:
      the old property value or null.