public void updateLookAndFeel(String name,String className){
  try {
    UIManager.setLookAndFeel(className);
  }
 catch (  Exception e) {
    String errMsg="The " + name + " look-and-feel ";
    if (e instanceof UnsupportedLookAndFeelException) {
      errMsg+="is not supported on this platform.";
    }
 else     if (e instanceof ClassNotFoundException) {
      errMsg+="could not be found.";
    }
 else {
      errMsg+="could not be loaded.";
    }
    log.error(errMsg);
  }
}

public void updateLookAndFeel ( String name , String className ) { try { UIManager . setLookAndFeel ( className ) ; } catch ( Exception e ) { String errMsg = "The " + name + " look-and-feel " ; if ( e instanceof UnsupportedLookAndFeelException ) { errMsg += "is not supported on this platform." ; } else if ( e instanceof ClassNotFoundException ) { errMsg += "could not be found." ; } else { errMsg += "could not be loaded." ; } log . error ( errMsg ) ; } }
change the look - and - feel to the specified class . alert the user if there were problems loading the plaf .
