Name
PreferenceChangeEvent
Synopsis
A
PreferenceChangeEvent
object is passed to the
preferenceChange( ) method of any
PreferenceChangeListener objects registered on a
Preferences object whenever a preferences value is
added to, removed from, or modified in that
Preferences node. getNode( )
returns the affected Preferences object.
getKey( ) returns name of the modified preference.
If the preference value was added or modified, getNewValue(
) returns that value. If a preference was deleted,
getNewValue( ) returns null.
Although this class inherits the Serializable
interface, it is not actually serializable.
Figure 16-129. java.util.prefs.PreferenceChangeEvent
public class PreferenceChangeEvent extends java.util.EventObject { // Public Constructors public PreferenceChangeEvent(Preferences node, String key, String newValue); // Public Instance Methods public String getKey( ); public String getNewValue( ); public Preferences getNode( ); }
Passed To
PreferenceChangeListener.preferenceChange( )
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access