You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Elvy <pi...@gmail.com> on 2008/05/29 14:46:05 UTC

Re: Look And Feel


"*" in boot delegation doesn't resolve the problem.

Another idea?



Richard S. Hall wrote:
> 
> Just a guess, but perhaps you are running into class loading issues.
> 
> I know that Swing plaf infrastructure makes some assumptions about how 
> it can locate required classes -- they think they can ask any class 
> loader to find them and this won't work if the class loader is a bundle. 
> We try to catch this case, but cannot catch all cases.
> 
> Just for a quick test, you can try to set felix' boot delegation 
> property in conf/config.properties to "*" and see if it solves your 
> issue. If so, then I would recommend trying to narrow it down to the 
> precise packages for which you need access.
> 
> -> richard
> 
> Elvy wrote:
>> We try to set the look and feel with the properties swing.defaultlaf or
>> in
>> the code but we have some problems with menu items. Menu items are not
>> visible and we have this error :
>>
>> UIDefaults.getUI() failed: no ComponentUI class for:
>> javax.swing.JMenuItem[,0,0,
>> 0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSi
>> ze=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=null,
>> paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIc
>> on=,rolloverSelectedIcon=,selectedIcon=,text=]
>> java.lang.Error
>>         at javax.swing.UIDefaults.getUIError(UIDefaults.java:711)
>>         at
>> javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:117)
>>         at javax.swing.UIDefaults.getUI(UIDefaults.java:741)
>>         at javax.swing.UIManager.getUI(UIManager.java:1012)
>>         at javax.swing.JMenuItem.updateUI(JMenuItem.java:232)
>>         at javax.swing.JMenuItem.init(JMenuItem.java:194)
>>         at javax.swing.JMenuItem.<init>(JMenuItem.java:133)
>>         at javax.swing.JMenuItem.<init>(JMenuItem.java:92)
>>
>> -----
>> Tell me something you don't know!
>>   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 
> 
> 


-----
Tell me something you don't know!
-- 
View this message in context: http://www.nabble.com/Look-And-Feel-tp16896587p17534931.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Look And Feel

Posted by "Richard S. Hall" <he...@ungoverned.org>.
Seems like we should add this to one of our FAQs...

-> richard

Elvy wrote:
> Now this is good answer !!!
>
> It now seems to work. I'll be back if anything happens ;-)
>
> THANKS a lot.
>
>
> Martin Thelian wrote:
>   
>> Hi,
>>
>> have you tried to manually configure the classloader the UIMangager
>> should use?
>>
>> E.g. you can use the following in your bundle Activator:
>> |> UIManager.put("ClassLoader", this.getClass().getClassLoader());
>>
>> Martin
>>
>> Elvy schrieb:
>>     
>>> "*" in boot delegation doesn't resolve the problem.
>>> Another idea?
>>>
>>>
>>> Richard S. Hall wrote:
>>>   
>>>       
>>>> Just a guess, but perhaps you are running into class loading issues.
>>>>
>>>> I know that Swing plaf infrastructure makes some assumptions about how 
>>>> it can locate required classes -- they think they can ask any class 
>>>> loader to find them and this won't work if the class loader is a bundle. 
>>>> We try to catch this case, but cannot catch all cases.
>>>>
>>>> Just for a quick test, you can try to set felix' boot delegation 
>>>> property in conf/config.properties to "*" and see if it solves your 
>>>> issue. If so, then I would recommend trying to narrow it down to the 
>>>> precise packages for which you need access.
>>>>
>>>> -> richard
>>>>
>>>> Elvy wrote:
>>>>     
>>>>         
>>>>> We try to set the look and feel with the properties swing.defaultlaf or
>>>>> in
>>>>> the code but we have some problems with menu items. Menu items are not
>>>>> visible and we have this error :
>>>>>
>>>>> UIDefaults.getUI() failed: no ComponentUI class for:
>>>>> javax.swing.JMenuItem[,0,0,
>>>>> 0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSi
>>>>> ze=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=null,
>>>>> paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIc
>>>>> on=,rolloverSelectedIcon=,selectedIcon=,text=]
>>>>> java.lang.Error
>>>>>         at javax.swing.UIDefaults.getUIError(UIDefaults.java:711)
>>>>>         at
>>>>> javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:117)
>>>>>         at javax.swing.UIDefaults.getUI(UIDefaults.java:741)
>>>>>         at javax.swing.UIManager.getUI(UIManager.java:1012)
>>>>>         at javax.swing.JMenuItem.updateUI(JMenuItem.java:232)
>>>>>         at javax.swing.JMenuItem.init(JMenuItem.java:194)
>>>>>         at javax.swing.JMenuItem.<init>(JMenuItem.java:133)
>>>>>         at javax.swing.JMenuItem.<init>(JMenuItem.java:92)
>>>>>       
>>>>>           
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>>
>>     
>
>
> -----
> Tell me something you don't know!
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Look And Feel

Posted by Elvy <pi...@gmail.com>.
Now this is good answer !!!

It now seems to work. I'll be back if anything happens ;-)

THANKS a lot.


Martin Thelian wrote:
> 
> Hi,
> 
> have you tried to manually configure the classloader the UIMangager
> should use?
> 
> E.g. you can use the following in your bundle Activator:
> |> UIManager.put("ClassLoader", this.getClass().getClassLoader());
> 
> Martin
> 
> Elvy schrieb:
>> "*" in boot delegation doesn't resolve the problem.
>> Another idea?
>>
>>
>> Richard S. Hall wrote:
>>   
>>> Just a guess, but perhaps you are running into class loading issues.
>>>
>>> I know that Swing plaf infrastructure makes some assumptions about how 
>>> it can locate required classes -- they think they can ask any class 
>>> loader to find them and this won't work if the class loader is a bundle. 
>>> We try to catch this case, but cannot catch all cases.
>>>
>>> Just for a quick test, you can try to set felix' boot delegation 
>>> property in conf/config.properties to "*" and see if it solves your 
>>> issue. If so, then I would recommend trying to narrow it down to the 
>>> precise packages for which you need access.
>>>
>>> -> richard
>>>
>>> Elvy wrote:
>>>     
>>>> We try to set the look and feel with the properties swing.defaultlaf or
>>>> in
>>>> the code but we have some problems with menu items. Menu items are not
>>>> visible and we have this error :
>>>>
>>>> UIDefaults.getUI() failed: no ComponentUI class for:
>>>> javax.swing.JMenuItem[,0,0,
>>>> 0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSi
>>>> ze=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=null,
>>>> paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIc
>>>> on=,rolloverSelectedIcon=,selectedIcon=,text=]
>>>> java.lang.Error
>>>>         at javax.swing.UIDefaults.getUIError(UIDefaults.java:711)
>>>>         at
>>>> javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:117)
>>>>         at javax.swing.UIDefaults.getUI(UIDefaults.java:741)
>>>>         at javax.swing.UIManager.getUI(UIManager.java:1012)
>>>>         at javax.swing.JMenuItem.updateUI(JMenuItem.java:232)
>>>>         at javax.swing.JMenuItem.init(JMenuItem.java:194)
>>>>         at javax.swing.JMenuItem.<init>(JMenuItem.java:133)
>>>>         at javax.swing.JMenuItem.<init>(JMenuItem.java:92)
>>>>       
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 
> 
> 


-----
Tell me something you don't know!
-- 
View this message in context: http://www.nabble.com/Look-And-Feel-tp16896587p17693929.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Look And Feel

Posted by Martin Thelian <Ma...@gmx.at>.
Hi,

have you tried to manually configure the classloader the UIMangager
should use?

E.g. you can use the following in your bundle Activator:
|> UIManager.put("ClassLoader", this.getClass().getClassLoader());

Martin

Elvy schrieb:
> "*" in boot delegation doesn't resolve the problem.
> Another idea?
>
>
> Richard S. Hall wrote:
>   
>> Just a guess, but perhaps you are running into class loading issues.
>>
>> I know that Swing plaf infrastructure makes some assumptions about how 
>> it can locate required classes -- they think they can ask any class 
>> loader to find them and this won't work if the class loader is a bundle. 
>> We try to catch this case, but cannot catch all cases.
>>
>> Just for a quick test, you can try to set felix' boot delegation 
>> property in conf/config.properties to "*" and see if it solves your 
>> issue. If so, then I would recommend trying to narrow it down to the 
>> precise packages for which you need access.
>>
>> -> richard
>>
>> Elvy wrote:
>>     
>>> We try to set the look and feel with the properties swing.defaultlaf or
>>> in
>>> the code but we have some problems with menu items. Menu items are not
>>> visible and we have this error :
>>>
>>> UIDefaults.getUI() failed: no ComponentUI class for:
>>> javax.swing.JMenuItem[,0,0,
>>> 0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSi
>>> ze=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=null,
>>> paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIc
>>> on=,rolloverSelectedIcon=,selectedIcon=,text=]
>>> java.lang.Error
>>>         at javax.swing.UIDefaults.getUIError(UIDefaults.java:711)
>>>         at
>>> javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:117)
>>>         at javax.swing.UIDefaults.getUI(UIDefaults.java:741)
>>>         at javax.swing.UIManager.getUI(UIManager.java:1012)
>>>         at javax.swing.JMenuItem.updateUI(JMenuItem.java:232)
>>>         at javax.swing.JMenuItem.init(JMenuItem.java:194)
>>>         at javax.swing.JMenuItem.<init>(JMenuItem.java:133)
>>>         at javax.swing.JMenuItem.<init>(JMenuItem.java:92)
>>>       

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Look And Feel

Posted by Mike Smoot <mi...@gmail.com>.
Alas, while Martin's approach helps (the lnf is correct as opposed to
getting Metal), all of my menu items still throw the exception referenced
above...

Mike

On Fri, Jun 6, 2008 at 7:52 AM, Elvy <pi...@gmail.com> wrote:

>
> This is no good solution since it forces the launch command to know about
> the
> jar containing the L&F. And your L&F jar may be something hidden inside one
> of your bundles. not good, not good...
>
> the solution lies in the other answer from "Martin Thelian"...
>
>
>
> Mike Smoot-2 wrote:
> >
> > The only way I've had success getting look and feel working is by setting
> > the boot classpath:
> >
> > java  -Xbootclasspath/a:bundle/com.jgoodies.looks_2.1.2.jar ...
> >
> >
> > Mike
> >
> > On Thu, May 29, 2008 at 5:46 AM, Elvy <pi...@gmail.com> wrote:
> >
> >>
> >>
> >> "*" in boot delegation doesn't resolve the problem.
> >>
> >> Another idea?
> >>
> >>
> >>
> >> Richard S. Hall wrote:
> >> >
> >> > Just a guess, but perhaps you are running into class loading issues.
> >> >
> >> > I know that Swing plaf infrastructure makes some assumptions about how
> >> > it can locate required classes -- they think they can ask any class
> >> > loader to find them and this won't work if the class loader is a
> >> bundle.
> >> > We try to catch this case, but cannot catch all cases.
> >> >
> >> > Just for a quick test, you can try to set felix' boot delegation
> >> > property in conf/config.properties to "*" and see if it solves your
> >> > issue. If so, then I would recommend trying to narrow it down to the
> >> > precise packages for which you need access.
> >> >
> >> > -> richard
> >> >
> >> > Elvy wrote:
> >> >> We try to set the look and feel with the properties swing.defaultlaf
> >> or
> >> >> in
> >> >> the code but we have some problems with menu items. Menu items are
> not
> >> >> visible and we have this error :
> >> >>
> >> >> UIDefaults.getUI() failed: no ComponentUI class for:
> >> >> javax.swing.JMenuItem[,0,0,
> >> >>
> >>
> 0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSi
> >> >>
> >>
> ze=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=null,
> >> >>
> >>
> paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIc
> >> >> on=,rolloverSelectedIcon=,selectedIcon=,text=]
> >> >> java.lang.Error
> >> >>         at javax.swing.UIDefaults.getUIError(UIDefaults.java:711)
> >> >>         at
> >> >> javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:117)
> >> >>         at javax.swing.UIDefaults.getUI(UIDefaults.java:741)
> >> >>         at javax.swing.UIManager.getUI(UIManager.java:1012)
> >> >>         at javax.swing.JMenuItem.updateUI(JMenuItem.java:232)
> >> >>         at javax.swing.JMenuItem.init(JMenuItem.java:194)
> >> >>         at javax.swing.JMenuItem.<init>(JMenuItem.java:133)
> >> >>         at javax.swing.JMenuItem.<init>(JMenuItem.java:92)
> >> >>
> >> >> -----
> >> >> Tell me something you don't know!
> >> >>
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> >> > For additional commands, e-mail: users-help@felix.apache.org
> >> >
> >> >
> >> >
> >>
> >>
> >> -----
> >> Tell me something you don't know!
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Look-And-Feel-tp16896587p17534931.html
> >> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> >> For additional commands, e-mail: users-help@felix.apache.org
> >>
> >>
> >
> >
> > --
> > ____________________________________________________________
> > Michael Smoot, Ph.D. Bioengineering Department
> > tel: 858-822-4756 University of California San Diego
> >
> >
>
>
> -----
> Tell me something you don't know!
> --
> View this message in context:
> http://www.nabble.com/Look-And-Feel-tp16896587p17694042.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
____________________________________________________________
Michael Smoot, Ph.D. Bioengineering Department
tel: 858-822-4756 University of California San Diego

Re: Look And Feel

Posted by Elvy <pi...@gmail.com>.
This is no good solution since it forces the launch command to know about the
jar containing the L&F. And your L&F jar may be something hidden inside one
of your bundles. not good, not good...

the solution lies in the other answer from "Martin Thelian"...



Mike Smoot-2 wrote:
> 
> The only way I've had success getting look and feel working is by setting
> the boot classpath:
> 
> java  -Xbootclasspath/a:bundle/com.jgoodies.looks_2.1.2.jar ...
> 
> 
> Mike
> 
> On Thu, May 29, 2008 at 5:46 AM, Elvy <pi...@gmail.com> wrote:
> 
>>
>>
>> "*" in boot delegation doesn't resolve the problem.
>>
>> Another idea?
>>
>>
>>
>> Richard S. Hall wrote:
>> >
>> > Just a guess, but perhaps you are running into class loading issues.
>> >
>> > I know that Swing plaf infrastructure makes some assumptions about how
>> > it can locate required classes -- they think they can ask any class
>> > loader to find them and this won't work if the class loader is a
>> bundle.
>> > We try to catch this case, but cannot catch all cases.
>> >
>> > Just for a quick test, you can try to set felix' boot delegation
>> > property in conf/config.properties to "*" and see if it solves your
>> > issue. If so, then I would recommend trying to narrow it down to the
>> > precise packages for which you need access.
>> >
>> > -> richard
>> >
>> > Elvy wrote:
>> >> We try to set the look and feel with the properties swing.defaultlaf
>> or
>> >> in
>> >> the code but we have some problems with menu items. Menu items are not
>> >> visible and we have this error :
>> >>
>> >> UIDefaults.getUI() failed: no ComponentUI class for:
>> >> javax.swing.JMenuItem[,0,0,
>> >>
>> 0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSi
>> >>
>> ze=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=null,
>> >>
>> paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIc
>> >> on=,rolloverSelectedIcon=,selectedIcon=,text=]
>> >> java.lang.Error
>> >>         at javax.swing.UIDefaults.getUIError(UIDefaults.java:711)
>> >>         at
>> >> javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:117)
>> >>         at javax.swing.UIDefaults.getUI(UIDefaults.java:741)
>> >>         at javax.swing.UIManager.getUI(UIManager.java:1012)
>> >>         at javax.swing.JMenuItem.updateUI(JMenuItem.java:232)
>> >>         at javax.swing.JMenuItem.init(JMenuItem.java:194)
>> >>         at javax.swing.JMenuItem.<init>(JMenuItem.java:133)
>> >>         at javax.swing.JMenuItem.<init>(JMenuItem.java:92)
>> >>
>> >> -----
>> >> Tell me something you don't know!
>> >>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> > For additional commands, e-mail: users-help@felix.apache.org
>> >
>> >
>> >
>>
>>
>> -----
>> Tell me something you don't know!
>> --
>> View this message in context:
>> http://www.nabble.com/Look-And-Feel-tp16896587p17534931.html
>> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
> 
> 
> -- 
> ____________________________________________________________
> Michael Smoot, Ph.D. Bioengineering Department
> tel: 858-822-4756 University of California San Diego
> 
> 


-----
Tell me something you don't know!
-- 
View this message in context: http://www.nabble.com/Look-And-Feel-tp16896587p17694042.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Look And Feel

Posted by Mike Smoot <mi...@gmail.com>.
The only way I've had success getting look and feel working is by setting
the boot classpath:

java  -Xbootclasspath/a:bundle/com.jgoodies.looks_2.1.2.jar ...


Mike

On Thu, May 29, 2008 at 5:46 AM, Elvy <pi...@gmail.com> wrote:

>
>
> "*" in boot delegation doesn't resolve the problem.
>
> Another idea?
>
>
>
> Richard S. Hall wrote:
> >
> > Just a guess, but perhaps you are running into class loading issues.
> >
> > I know that Swing plaf infrastructure makes some assumptions about how
> > it can locate required classes -- they think they can ask any class
> > loader to find them and this won't work if the class loader is a bundle.
> > We try to catch this case, but cannot catch all cases.
> >
> > Just for a quick test, you can try to set felix' boot delegation
> > property in conf/config.properties to "*" and see if it solves your
> > issue. If so, then I would recommend trying to narrow it down to the
> > precise packages for which you need access.
> >
> > -> richard
> >
> > Elvy wrote:
> >> We try to set the look and feel with the properties swing.defaultlaf or
> >> in
> >> the code but we have some problems with menu items. Menu items are not
> >> visible and we have this error :
> >>
> >> UIDefaults.getUI() failed: no ComponentUI class for:
> >> javax.swing.JMenuItem[,0,0,
> >>
> 0x0,invalid,alignmentX=0.0,alignmentY=0.0,border=,flags=0,maximumSize=,minimumSi
> >>
> ze=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=null,
> >>
> paintBorder=false,paintFocus=false,pressedIcon=,rolloverEnabled=false,rolloverIc
> >> on=,rolloverSelectedIcon=,selectedIcon=,text=]
> >> java.lang.Error
> >>         at javax.swing.UIDefaults.getUIError(UIDefaults.java:711)
> >>         at
> >> javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:117)
> >>         at javax.swing.UIDefaults.getUI(UIDefaults.java:741)
> >>         at javax.swing.UIManager.getUI(UIManager.java:1012)
> >>         at javax.swing.JMenuItem.updateUI(JMenuItem.java:232)
> >>         at javax.swing.JMenuItem.init(JMenuItem.java:194)
> >>         at javax.swing.JMenuItem.<init>(JMenuItem.java:133)
> >>         at javax.swing.JMenuItem.<init>(JMenuItem.java:92)
> >>
> >> -----
> >> Tell me something you don't know!
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > For additional commands, e-mail: users-help@felix.apache.org
> >
> >
> >
>
>
> -----
> Tell me something you don't know!
> --
> View this message in context:
> http://www.nabble.com/Look-And-Feel-tp16896587p17534931.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
____________________________________________________________
Michael Smoot, Ph.D. Bioengineering Department
tel: 858-822-4756 University of California San Diego