code: public static ImageIcon loadImageIcon(final String iconName, final Class<?> clazz) {
          ImageIcon icon = null;
  
          if (iconName != null) {
              final URL iconResource = clazz.getResource(iconName);
              if (iconResource == null) {
                  LOGGER.error("Icon could not be loaded: '" + iconName);
                  icon = null;
              } else {
                  icon = new ImageIcon(iconResource);
              }
          }
  
          return icon;
      }
docs: Loads an image icon from a resource file.
  
  @param iconName Name of the resource file to be loaded.
  @param clazz    Class for which the resource exists.
  
  @return Image icon if it could be loaded, null otherwise.