- May 11, 2005
- 641
- 0
- 0
Ok, so I want to make an application of mine themable. I'm kind of cheating and trying to use 3rd Party Java Look And Feel .jars
So,
I first list all the files in the 'theme' dir
I loop the listed files for ones which end in ".jar"
I create a JarFile object for any Jar Files which are found
For each JarFile I loop through all the files looking for ones which end in "LookAndFeel.class"
If found, I create a URLClassLoader object using the JarFile URL
Then (after converting the LookAndFeel class file into a Class name (i.e net/lookandfeel/LookAndFeel.class becomes net.lookandfeel.LookAndFeel) I try and apply the them via UIManager.setLookAndFeel(className);
It doesn't work! I get fileNotFoundExceptions for some of the support files, other times ClassNotFoundExceptions
Any help would be great
So,
I first list all the files in the 'theme' dir
I loop the listed files for ones which end in ".jar"
I create a JarFile object for any Jar Files which are found
For each JarFile I loop through all the files looking for ones which end in "LookAndFeel.class"
If found, I create a URLClassLoader object using the JarFile URL
Then (after converting the LookAndFeel class file into a Class name (i.e net/lookandfeel/LookAndFeel.class becomes net.lookandfeel.LookAndFeel) I try and apply the them via UIManager.setLookAndFeel(className);
It doesn't work! I get fileNotFoundExceptions for some of the support files, other times ClassNotFoundExceptions
Any help would be great
