UIDefaults.LazyInputMap
, UIDefaults.ProxyLazyValue
UIDefaults
public static interface UIDefaults.LazyValue
getXXX(key)
methods. Lazy values are useful for defaults that are expensive to construct or are seldom retrieved. The first time a LazyValue
is retrieved its "real value" is computed by calling LazyValue.createValue()
and the real value is used to replace the LazyValue
in the UIDefaults
table. Subsequent lookups for the same key return the real value. Here's an example of a LazyValue
that constructs a Border
: Object borderLazyValue = new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { return new BorderFactory.createLoweredBevelBorder(); } }; uiDefaultsTable.put("MyBorder", borderLazyValue);
Modifier and Type | Method | Description |
---|---|---|
Object |
createValue |
Creates the actual value retrieved from the UIDefaults table. |
Object createValue(UIDefaults table)
UIDefaults
table. When an object that implements this interface is retrieved from the table, this method is used to create the real value, which is then stored in the table and returned to the calling method.table
- a UIDefaults
tableObject
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/UIDefaults.LazyValue.html