JDK-4378245 : Custom LookandFeel classes cannot be loaded from a custom classloader using UIMa
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2000-10-11
  • Updated: 2000-10-23
  • Resolved: 2000-10-23
Related Reports
Duplicate :  
Description

Name: cl74495			Date: 10/11/2000


The method setLookandFeel() in javax.swing.UIManager has two versions,
one which takes a string specifying the name of the LaF class to load
and one accepts the already loaded LaF class.

The method that accepts a string then calls javax.swing.SwingUtilities.loadSystemClass()
to load the specified class. This will bypass any custom classloaders
that are in use. What this means is that custom look and feel classes
must be added to the VM's classpath before the application is started,
they cannot be made available via a custom classloader after the VM
has started.

This is similar to bug #4203151 and the same solution should work.
(Review ID: 110667) 
======================================================================

Comments
WORK AROUND Name: cl74495 Date: 10/11/2000 Provide an already loaded class to UIManager.setLookandFeel(). For example, instead of: javax.swing.UIManager.setLookAndFeel("com.mycompany.MyLookAndFeel"); you can use: Class c = Class.forname("com.mycompany.MyLokkAndFeel"); javax.swing.LookAndFeel laf = (LookAndFeel)c.newInstance(); javax.swing.UIManager.setLookAndFeel(laf); ======================================================================
11-06-2004

EVALUATION This is a duplicate of 4155617, refer to it for more information. scott.violet@eng 2000-10-23
23-10-2000