You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Niko_K <ni...@krismer.de> on 2009/10/14 22:18:26 UTC

Howto can i work with Look And Feel Classes?

Hi,

i created a bundle which shows a Swing Gui.
And that's where my problem starts. I want to show the user a selection of
different look and feels, he can choose from.
In doing so, i need to import classes for the LAFs. For example:
<code>
import com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel;
</code>

However, as soon as i use the code above, i get the following error:
"Access restriction: The type NimbusLookAndFeel is not accessible due to
restriction on required library
/usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/rt.jar"

I could not solve this problem, even with trying to add the package to the
Import-Package property in the MANIFEST:MF file.

Is there another way to import these classes? Can i even import the LAF
classes in an OSGI bundle?

Regards,
Niko

-- 
View this message in context: http://www.nabble.com/Howto-can-i-work-with-Look-And-Feel-Classes--tp25898282p25898282.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: Howto can i work with Look And Feel Classes?

Posted by Niko_K <ni...@krismer.de>.
Thanks! This works.

However, eclipse gives me an error in the exporting bundle:
"Package 'com.sun.java.swing.plaf.windows' does not exist in this plug-in"

I get this warning for all my LaF classes:
"com.sun.java.swing.plaf.gtk,
 com.sun.java.swing.plaf.motif,
 com.sun.java.swing.plaf.nimbus,
 com.sun.java.swing.plaf.windows,
 javax.swing.plaf,
 javax.swing.plaf.metal"

Greetings,
Niko


Marcel Offermans wrote:
> 
> Something needs to export those classes too. In this case, since  
> they're part of the JDK, this should be the system bundle. Check out  
> the documentation on the Felix on how to do that:
> 
> http://felix.apache.org/site/apache-felix-framework-usage-documentation.html#ApacheFelixFrameworkUsageDocumentation-configuringframework
> 
> Look for: org.osgi.framework.system.packages.extra
> 
> Greetings, Marcel
> 

-- 
View this message in context: http://www.nabble.com/Howto-can-i-work-with-Look-And-Feel-Classes--tp25898282p25905423.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: Howto can i work with Look And Feel Classes?

Posted by Marcel Offermans <ma...@luminis.nl>.
On Oct 14, 2009, at 22:18 , Niko_K wrote:

> I could not solve this problem, even with trying to add the package  
> to the
> Import-Package property in the MANIFEST:MF file.

That's one half of the solution!

> Is there another way to import these classes? Can i even import the  
> LAF
> classes in an OSGI bundle?


Something needs to export those classes too. In this case, since  
they're part of the JDK, this should be the system bundle. Check out  
the documentation on the Felix on how to do that:

http://felix.apache.org/site/apache-felix-framework-usage-documentation.html#ApacheFelixFrameworkUsageDocumentation-configuringframework

Look for: org.osgi.framework.system.packages.extra

Greetings, Marcel

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