Most visited

Recently visited

Added in API level 1

PreferenceChangeEvent

public class PreferenceChangeEvent
extends EventObject

java.lang.Object
   ↳ java.util.EventObject
     ↳ java.util.prefs.PreferenceChangeEvent


Preferences节点发出的事件,用于指示首选项已添加,删除或其值已更改。

请注意,尽管PreferenceChangeEvent从EventObject继承了Serializable接口,但它并不是可序列化的。 实施适当的序列化方法来抛出NotSerializableException。

也可以看看:

Summary

Inherited fields

From class java.util.EventObject

Public constructors

PreferenceChangeEvent(Preferences node, String key, String newValue)

构造一个新的 PreferenceChangeEvent实例。

Public methods

String getKey()

返回已更改的首选项的键。

String getNewValue()

返回首选项的新值。

Preferences getNode()

返回发出事件的首选节点。

Inherited methods

From class java.util.EventObject
From class java.lang.Object

Public constructors

PreferenceChangeEvent

Added in API level 1
PreferenceChangeEvent (Preferences node, 
                String key, 
                String newValue)

构造一个新的 PreferenceChangeEvent实例。

Parameters
node Preferences: The Preferences node that emitted the event.
key String: The key of the preference that was changed.
newValue String: The new value of the preference, or null if the preference is being removed.

Public methods

getKey

Added in API level 1
String getKey ()

返回已更改的首选项的键。

Returns
String The key of the preference that was changed.

getNewValue

Added in API level 1
String getNewValue ()

返回首选项的新值。

Returns
String The new value for the preference, or null if the preference was removed.

getNode

Added in API level 1
Preferences getNode ()

返回发出事件的首选节点。

Returns
Preferences The preference node that emitted the event.

Hooray!