Using Substance Look And Feel in OSGi

I experienced some problems with Substance in OSGi. Using this code :

SubstanceLookAndFeel.setSkin(new BusinessBlackSteelSkin());

I got different errors, like :

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at 

I found a simple solution to make Substance work in OSGi :

try {
      UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel());
} catch (UnsupportedLookAndFeelException e) {
      LoggerFactory.getLogger(getClass()).error(e.getMessage(), e);
UIManager.getLookAndFeelDefaults().put("ClassLoader", SubstanceBusinessBlackSteelLookAndFeel.class.getClassLoader());

With that code, i've no more problems using Substance Look And Feel.

Hope that will help someone.

Related articles

  • Substance 6.0 is out
  • OSGi 4.2 Entreprise Release is available !
  • JTheque is going to OSGi
  • Modular Java – Book Review
  • Bundle non-OSGi dependencies with Maven
  • OSGi - Simple Hello World with services
  • Comments

    Comments powered by Disqus