code: public ImageIcon loadImage( String imageName )
     {
        try
        {
           ClassLoader classloader = getClass().getClassLoader();
           java.net.URL url = classloader.getResource( imageName );
           if ( url != null )
           {
              ImageIcon icon = new ImageIcon( url );
              return icon;
           }
        }
        catch( Exception e )
        {
           e.printStackTrace();
        }
        throw new IllegalArgumentException( "Unable to load image: " + imageName );
     }
docs: Helper method to load an image file from the CLASSPATH
  @param imageName the package and name of the file to load relative to the CLASSPATH
  @return an ImageIcon instance with the specified image file
  @throws IllegalArgumentException if the image resource cannot be loaded.