Re: Dynamically load laf
- From: Daniel <daik.no-spam@xxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Nov 2005 01:27:01 GMT
Now that I've tried this a bit more there seems to be a major problem
with this solution.
I load the Look and feel class properly and I can set the look and
feel, but it seems that the classes it depend on is causing problems.
What happens is this:
I set the laf to one from the "plugin directory", restart the
application
I get lots of exceptions when I restart the program. They are all very
similar and this is one example:
UIDefaults.getUI() failed: no ComponentUI class for:
javax.swing.JMenuBar[,0,0,0x0,invalid,alignmentX=null,alignmentY=null,border=,flags=0,maximumSize=,minimumSize=,preferredSize=,margin=,paintBorder=true]
java.lang.Error
at javax.swing.UIDefaults.getUIError(UIDefaults.java:689)
at javax.swing.UIDefaults.getUI(UIDefaults.java:719)
at javax.swing.UIManager.getUI(UIManager.java:784)
at javax.swing.JMenuBar.updateUI(JMenuBar.java:125)
at javax.swing.JMenuBar.<init>(JMenuBar.java:93)
at se.wexiodisk.service.MainWindow.<init>(MainWindow.java:35)
at se.wexiodisk.service.Diagnosetool.<init>(MyApp.java:142)
at se.wexiodisk.service.Diagnosetool.main(MyApp.java:178)
What am I missing? I feel it's obvious but I can't think of it now.
I think I've realized it now.
What I need to do is to add the desired jar to the classloaders search
path. Unfortunatly this method has protected access on the
URLClassLoader so I am a bit at loss how to solve this problem.
The look and feel appear in the list over installed look and feels,
but as you can see I can not use it. I get this error for every
component in my app..
regards
Daniel
.
- References:
- Dynamically load laf
- From: Daniel
- Re: Dynamically load laf
- From: Daniel
- Dynamically load laf
- Prev by Date: Re: Dynamically load laf
- Next by Date: Re: Dynamically load laf
- Previous by thread: Re: Dynamically load laf
- Next by thread: Re: Dynamically load laf
- Index(es):
Relevant Pages
|