APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.event

public final Class SwingPropertyChangeSupport

extends PropertyChangeSupport
Class Inheritance
Imports
java.beans.PropertyChangeEvent, .PropertyChangeSupport, java.io.Serial, javax.swing.SwingUtilities

This subclass of java.beans.PropertyChangeSupport is almost identical in functionality. The only difference is if constructed with SwingPropertyChangeSupport(sourceBean, true) it ensures listeners are only ever notified on the Event Dispatch Thread.
Author
Igor Kushnirskiy

Field Summary

Modifier and TypeField and Description
private final boolean
notifyOnEDT

whether to notify listeners on EDT

private static final long
serialVersionUID

Hides java.beans.PropertyChangeSupport.serialVersionUID.

Use serialVersionUID from JDK 1.2 for interoperability.

Constructor Summary

AccessConstructor and Description
public
SwingPropertyChangeSupport(Object
The bean to be given as the source for any events.
sourceBean
)

Constructs a SwingPropertyChangeSupport object.

public
SwingPropertyChangeSupport(Object
the bean to be given as the source for any events
sourceBean
,
boolean
whether to notify listeners on the Event Dispatch Thread only
notifyOnEDT
)

Constructs a SwingPropertyChangeSupport object.

Method Summary

Modifier and TypeMethod and Description
public void
firePropertyChange(final PropertyChangeEvent evt)

Overrides java.beans.PropertyChangeSupport.firePropertyChange.

Fires a property change event to listeners that have been registered to track updates of all properties or a property with the specified name.

public boolean

Returns:

notifyOnEDT property
isNotifyOnEDT
()

Returns notifyOnEDT property.

Inherited from java.beans.PropertyChangeSupport:
addPropertyChangeListeneraddPropertyChangeListenerfireIndexedPropertyChangefireIndexedPropertyChangefireIndexedPropertyChangefirePropertyChangefirePropertyChangefirePropertyChangegetPropertyChangeListenersgetPropertyChangeListenershasListenersremovePropertyChangeListenerremovePropertyChangeListener

Field Detail

notifyOnEDTback to summary
private final boolean notifyOnEDT

whether to notify listeners on EDT

Since
1.6
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.beans.PropertyChangeSupport.serialVersionUID.

Use serialVersionUID from JDK 1.2 for interoperability.

Annotations
@Serial

Constructor Detail

SwingPropertyChangeSupportback to summary
public SwingPropertyChangeSupport(Object sourceBean)

Constructs a SwingPropertyChangeSupport object.

Parameters
sourceBean:Object

The bean to be given as the source for any events.

Exceptions
NullPointerException:
if sourceBean is null
SwingPropertyChangeSupportback to summary
public SwingPropertyChangeSupport(Object sourceBean, boolean notifyOnEDT)

Constructs a SwingPropertyChangeSupport object.

Parameters
sourceBean:Object

the bean to be given as the source for any events

notifyOnEDT:boolean

whether to notify listeners on the Event Dispatch Thread only

Exceptions
NullPointerException:
if sourceBean is null
Since
1.6

Method Detail

firePropertyChangeback to summary
public void firePropertyChange(final PropertyChangeEvent evt)

Overrides java.beans.PropertyChangeSupport.firePropertyChange.

Doc from java.beans.PropertyChangeSupport.firePropertyChange.

Fires a property change event to listeners that have been registered to track updates of all properties or a property with the specified name.

No event is fired if the given event's old and new values are equal and non-null.

If isNotifyOnEDT is true and called off the Event Dispatch Thread this implementation uses SwingUtilities.invokeLater to send out the notification on the Event Dispatch Thread. This ensures listeners are only ever notified on the Event Dispatch Thread.

Exceptions
NullPointerException:
if evt is null
Since
1.6
isNotifyOnEDTback to summary
public boolean isNotifyOnEDT()

Returns notifyOnEDT property.

Returns:boolean

notifyOnEDT property

Since
1.6
See Also
SwingPropertyChangeSupport(Object sourceBean, boolean notifyOnEDT)