2012-02-14

Exception 'Cannot load com.apple.laf.AquaLookAndFeel' with JFreeChart in a Web Application

I use JFreeChart in a web application and with Mac OS I got this exception:

Cannot load com.apple.laf.AquaLookAndFeel javax.swing.UIManager.initializeDefaultLAF


Because I don't need any "Look and Feel" related to a JSF application, I set the default Motiv L&F before creating the chart.

try {
    UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
} catch (Exception e) {
    e.printStackTrace();
}
If your writing an application with Swing, there're some other hints in the web solving this problem.