Link to home
Start Free TrialLog in
Avatar of k6t
k6t

asked on

need help, swing application problem with java help 2.0

Does someone know what purpose's this code using for?

        javax.swing.UIManager.getLookAndFeelDefaults().put("ClassLoader", getClass().getClassLoader());


My application using JDesktopPane to build MDI environments, if i put that code begin of my application (before show scrollpane app) my application worked without any error, but my application using javahelp to support help to user, when invoke help it throws error below

UIDefaults.getUI() failed: no ComponentUI class for: javax.help.JHelpContentViewer[,0,0,0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=]
java.lang.Error

if i clear line javax.swing.UIManager.getLookAndFeelDefaults().put("ClassLoader", getClass().getClassLoader()); out of my application, javahelp working correct but if i create any JInternalFrame it show error like this :

UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JInternalFrame$JDesktopIcon[,0,0,0x0,invalid,hidden,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSize=,preferredSize=]
java.lang.Error

Please show me what purpose of line : javax.swing.UIManager.getLookAndFeelDefaults().put("ClassLoader", getClass().getClassLoader());

and how can i fix this problem, thanks
Avatar of girionis
girionis
Flag of Greece image

k6t,
> javax.swing.UIManager.getLookAndFeelDefaults().put("ClassLoader",
> getClass().getClassLoader());

This line puts in the UIDefaults (which is a hashtable and you get it when you do javax.swing.UIManager.getLookAndFeelDefaults()) the classloader that renders the component you are using.

For a possible solution have a look here: http://javootoo.l2fprod.com/forum/viewtopic.php?topic=237&forum=1&10
ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of k6t
k6t

ASKER

hi, thanks for reply, but my application not using any another skin, it using default skin of swing, so in block of code you give me, which java file i need to put in that code? (replace skinlf.jar), thanks
Hello, sorry I just saw your message, do you still have problem with the l&f?