Home

propertyChangePropertyChangeEvent

PropertyChangeEvent is a class in the JavaBeans API that represents a notification about a change to a bean’s bound property. It is used to inform listeners that a property value has changed from an old value to a new value.

The event carries details about the change, including the source object that fired the event, the name

PropertyChangeEvent is part of the JavaBeans binding mechanism. Beans that expose bound properties typically maintain a

Listeners interested in property changes implement the PropertyChangeListener interface, which requires the propertyChange(PropertyChangeEvent evt) method. In

In addition to PropertyChangeEvent, Java also supports indexed property changes through IndexedPropertyChangeEvent for properties that are

of
the
property
that
changed,
and
the
previous
and
new
values.
Specifically,
a
PropertyChangeEvent
typically
provides
accessors
for
the
source,
property
name,
old
value,
and
new
value
through
methods
like
getSource(),
getPropertyName(),
getOldValue(),
and
getNewValue().
A
common
constructor
accepts
the
four
pieces
of
information:
the
source
object,
the
property
name,
the
old
value,
and
the
new
value.
list
of
PropertyChangeListeners
and
notify
them
when
a
property
changes
by
creating
and
firing
a
PropertyChangeEvent.
The
notification
is
usually
performed
via
a
helper
such
as
PropertyChangeSupport,
which
aggregates
listeners
and
handles
the
dispatch
of
events
to
all
registered
listeners.
the
event
handler,
listeners
examine
evt.getPropertyName()
and
react
to
changes
accordingly,
often
updating
user
interfaces
or
triggering
related
business
logic.
array-
or
list-like.
Overall,
PropertyChangeEvent
is
a
foundational
element
for
decoupled,
event-driven
property
binding
in
Java.
See
also
PropertyChangeSupport,
PropertyChangeListener,
and
IndexedPropertyChangeEvent.