ui/src/main/java/ucar/nc2/ui/util/Resource.java
public static ImageIcon getIcon( String fullIconName, boolean errMsg) {
    ImageIcon icon = null;

    java.net.URL iconR = cl.getResource(fullIconName);
    if (debugIcon) {
      System.out.println("classLoader "+cl.getClassLoader());
      System.out.println("  Resource.getIcon on "+fullIconName+" = "+iconR);
    }

    if (iconR != null)
      icon = new ImageIcon(iconR);

    if ((icon == null) && errMsg) System.out.println("  ERROR: Resource.getIcon failed on "+fullIconName);
    else if (debugIcon) System.out.println("  Resource.getIcon ok on "+fullIconName);

    return icon;
  }
public static ImageIcon getIcon( String fullIconName, boolean errMsg) {
    ImageIcon icon = null;

    java.net.URL iconR = cl.getResource(fullIconName);
    if (debugIcon) {
      System.out.println("classLoader "+cl.getClassLoader());
      System.out.println("  Resource.getIcon on "+fullIconName+" = "+iconR);
    }

    if (iconR != null)
      icon = new ImageIcon(iconR);

    if ((icon == null) && errMsg) System.out.println("  ERROR: Resource.getIcon failed on "+fullIconName);
    else if (debugIcon) System.out.println("  Resource.getIcon ok on "+fullIconName);

    return icon;
  }
public static ImageIcon getIcon ( String fullIconName , boolean errMsg ) { ImageIcon icon = null ; java . net . URL iconR = cl . getResource ( fullIconName ) ; if ( debugIcon ) { System . out . println ( "classLoader " + cl . getClassLoader ( ) ) ; System . out . println ( "  Resource.getIcon on " + fullIconName + " = " + iconR ) ; } if ( iconR != null ) icon = new ImageIcon ( iconR ) ; if ( ( icon == null ) && errMsg ) System . out . println ( "  ERROR: Resource.getIcon failed on " + fullIconName ) ; else if ( debugIcon ) System . out . println ( "  Resource.getIcon ok on " + fullIconName ) ; return icon ; }
Get a gif file, make it into an ImageIcon.
@param fullIconName full path name of gif file (use forward slashes!)
@param errMsg print err message on failure
@return ImageIcon or null on failure
Get a gif file make it into an ImageIcon .