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 ( );
}