Author: echatellier Date: 2013-01-14 10:14:33 +0100 (Mon, 14 Jan 2013) New Revision: 3810 Url: http://forge.codelutin.com/projects/isis-fish/repository/revisions/3810 Log: fixes #1916: init nimbus only if ui is activated Modified: trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java Modified: trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java =================================================================== --- trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java 2012-12-19 14:00:54 UTC (rev 3809) +++ trunk/src/main/java/fr/ifremer/isisfish/IsisFish.java 2013-01-14 09:14:33 UTC (rev 3810) @@ -191,13 +191,16 @@ * @throws UnsupportedLookAndFeelException */ private static void initLookAndFeel() throws InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException { - for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) { - if ("Nimbus".equals(laf.getName())) { - try { - UIManager.setLookAndFeel(laf.getClassName()); - } catch (ClassNotFoundException e) { - // could not fin nimbus look-and-feel - log.warn("Can't install nimbus"); + // must be done only if ui is activated (bug on java 7) + if (config.isLaunchUI()) { + for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(laf.getName())) { + try { + UIManager.setLookAndFeel(laf.getClassName()); + } catch (ClassNotFoundException e) { + // could not fin nimbus look-and-feel + log.warn("Can't install nimbus"); + } } } }