Preferences node to indicate that
a preference has been added, removed or has had its value changed.Note, that although PreferenceChangeEvent inherits Serializable interface from EventObject, it is not intended to be Serializable. Appropriate serialization methods are implemented to throw NotSerializableException.
Preferences, PreferenceChangeListener, NodeChangeEvent
| Modifier and Type | Field and Description |
|---|---|
| private String | key
Key of the preference that changed. |
| private String | newValue
New value for preference, or |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | PreferenceChangeEvent(Preferences
The Preferences node that emitted the event. node, String The key of the preference that was changed. key, String The new value of the preference, or newValue)null
if the preference is being removed.Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: The key of the preference that was changed.Returns the key of the preference that was changed. |
| public String | Returns: The new value for the preference, ornull if the
preference was removed.Returns the new value for the preference. |
| public Preferences | Returns: The preference node that emitted the event.Returns the preference node that emitted the event. |
| private void | readObject(ObjectInputStream in)
Throws NotSerializableException, since PreferenceChangeEvent objects are not intended to be serializable. |
| private void | writeObject(ObjectOutputStream out)
Throws NotSerializableException, since NodeChangeEvent objects are not intended to be serializable. |
| key | back to summary |
|---|---|
| private String key Key of the preference that changed. | |
| newValue | back to summary |
|---|---|
| private String newValue New value for preference, or | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| PreferenceChangeEvent | back to summary |
|---|---|
| public PreferenceChangeEvent(Preferences node, String key, String newValue) Constructs a new
| |
| getKey | back to summary |
|---|---|
| public String getKey() Returns the key of the preference that was changed.
| |
| getNewValue | back to summary |
|---|---|
| public String getNewValue() Returns the new value for the preference.
| |
| getNode | back to summary |
|---|---|
| public Preferences getNode() Returns the preference node that emitted the event.
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream in) throws NotSerializableException Throws NotSerializableException, since PreferenceChangeEvent objects are not intended to be serializable. | |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream out) throws NotSerializableException Throws NotSerializableException, since NodeChangeEvent objects are not intended to be serializable. | |