JDK-4138667 : Swing doesn't know where to look for classes (but I do)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1998-05-14
  • Updated: 2000-12-14
  • Resolved: 2000-12-14
Related Reports
Duplicate :  
Description

Name: rk38400			Date: 05/14/98


In my system I implement a custom class loader
which loads (among other things) the Swing package.

When Swing goes to look for other look&feel packages,
it doesn't think to ask my class loader to go
find them.  My class loader knows where to look,
but the standard classpath does not.

I can place the L&F files in the CLASSPATH, but I
don't want to.  That involves delivering the 
files, and I don't have permission to upgrade them
on my customer's machines.  I'd rather they come
look at my machine for the latest&greatest version
of all files.
(Review ID: 26882)
======================================================================

Comments
WORK AROUND Name: rk38400 Date: 05/14/98 Place swing L&F jar files in CLASSPATH. ======================================================================
11-06-2004

EVALUATION I am surprised at what the submitter observes. But neither am I a classloader expert ;-) so this needs further investigation. Swing loads the look and feel classes using Class.forName() method. According to the documentation for Class.forName() it says that the class is loaded using the class loader of the calling method. Given that the submitter has written his own class loader, which is used to load the Swing package, this means that the look and feel package should be loaded using his class loader and therefore he should not have to specify these classes in his class path. sunita.mani@Eng 1998-05-29 If you need to use an alternate ClassLoader for the UI classes use the UIDefaults property 'ClassLoader'. I am closing this as a dup of 4155617, which is when the support for the 'ClassLoader' was added. scott.violet@eng 2000-12-14
14-12-2000