Apache NetBeans 10.0

Why can’t I load properties using UIDefaults?

You may encounter this problem while porting a Swing application to the NetBeans platform or when using a third-party library like SwingX. While the following code works in a standalone Swing application, it does not load the property in a platform-based application:

This fails in the platform because of JDK bug #4834404.
Although the best solution is to replace the original code to load properties in a way that uses the correct class loader,
that may not be possible when using a third-party library.
In these cases, your module can work around the problem by using code similar to this:

Yet another alternative is to ensure the resource bundles are available to the startup classloader.
You can do this by placing the JAR containing the resource bundles
in the lib subdirectory of your platform cluster,
although this workaround has not been tested.

Note: An (untested) possible workaround is to first call UIManager.put ("ClassLoader", Lookup.getDefault().lookup(ClassLoader.class)).

<hr/>
Applies to: NetBeans 6.8 and above

Apache Migration Information

The content in this page was kindly donated by Oracle Corp. to the
Apache Software Foundation.

Apache NetBeans is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.