Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Swing classes not found when using DS
Swing classes not found when using DS [message #100340] Thu, 25 October 2007 17:20 Go to next message
Michael Furtak is currently offline Michael Furtak
Messages: 5
Registered: July 2009
Junior Member
I am trying out the Declarative Services functionality from the equinox
3.4 I20071023-0800 build and am running into some class loading problems.

I have a bundle that winds up affecting some Swing classes (menu items).
It produces errors now that I have switched it to use DS instead of the
Service Activator Toolkit. The error is:

UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JMenuItem
...

This has to do with Swing not being able to find the correct UI classes if
you are not using the default LaF. (Just changing it to the System LaF is
enough to produce this.)

My question is this: Why does this happen with DS and not with the SAT?
Is DS ignoring the bundle's DynamicImport-Package: * statement? (This is
the only way I've found to solve these issues.)

Any insight would be appreciated.

Thanks,
-Mike
Re: Swing classes not found when using DS [message #734632 is a reply to message #100340] Sun, 09 October 2011 00:10 Go to previous messageGo to next message
pfxo  is currently offline pfxo
Messages: 1
Registered: October 2011
Junior Member
I have the same error if I use Java Swing inside bundles. If I start my bundle activator without Spring DM, all work good. But as far as I use Spring DM, I get always this UIDefaults.getUI() failed: no ComponentUI class for: javax.swing.JPanel... errors.

But I found a solution on this post: www.eclipse.org/forums/index.php/mv/msg/142233/448472/#msg_448472

You need to write
UIManager.put("ClassLoader", getClass().getClassLoader());
before you use Swing. I don't know why this error happen only in coherence with Spring DM.
Re: Swing classes not found when using DS [message #742224 is a reply to message #734632] Thu, 20 October 2011 09:46 Go to previous message
Ivan Larionov is currently offline Ivan Larionov
Messages: 37
Registered: July 2009
Member
Hi,

Have you tried ?
Import-Package: javax.swing,...

On 09.10.2011 3:10, pfxo wrote:
> I have the same error if I use Java Swing inside bundles. If I start my
> bundle activator without Spring DM, all work good. But as far as I use
> Spring DM, I get always this UIDefaults.getUI() failed: no ComponentUI
> class for: javax.swing.JPanel... errors.
>
> But I found a solution on this post:
> www.eclipse.org/forums/index.php/mv/msg/142233/448472/#msg_448472
>
> You need to write UIManager.put("ClassLoader",
> getClass().getClassLoader()); before you use Swing. I don't know why
> this error happen only in coherence with Spring DM.
Previous Topic:Eclipse Update Site Mirror Tool
Next Topic:Equinox newbie. please help!
Goto Forum:
  


Current Time: Fri Sep 19 11:51:41 GMT 2014

Powered by FUDForum. Page generated in 0.01612 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software