Skip to main content

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 
org.pushingpixels.substance.internal.utils.SubstanceColorUtilities.getDefaultBackgroundColor(SubstanceColorUtilities.java:823)

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.

Comments

Comments powered by Disqus