Tag Archives: swing

Using Substance Look and Feel within OSGi

I am currently porting the KAT to OSGi in order to get a more sphisticated runtime environment that is separated from the user interface. The reason is that we also want to develop a web version of Semaplorer. However, I had some problem with running the current GUI within OSGi. The reason was that the Substance classes could not be located and I got a bunch of exceptions like the following:

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

Some searching around the web lead me to the following solution:

UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel());
UIManager.getLookAndFeelDefaults().put("ClassLoader", SubstanceLoader.class.getClassLoader());
It seems that swing does not get the right class loader.