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.

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    Markdown is turned off in code blocks:
     [This is not a link](

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see