Example #1
0
  ThemeManager(final JFrame frame) {

    // this line needs to be implemented in order to make JWS work properly
    UIManager.getLookAndFeelDefaults().put("ClassLoader", frame.getClass().getClassLoader());

    try { // This could fail if JGoodies is not available
      com.jgoodies.looks.Options.setPopupDropShadowEnabled(true); // Enabled JGoodies drop shadow
    } catch (Exception e) {
      Logger.getLogger(ThemeManager.class.getName())
          .log(Level.FINE, "JGoodies L&F was not found", e);
    }

    Preferences pref = Preferences.userNodeForPackage(ThemeManager.class);

    setLookAndFeel(pref.get(LF, UIManager.getCrossPlatformLookAndFeelClassName()));
  }