class SwingImage extends SwingElement implements XulImage {

  public void setSrc( String src ) {

    // First try the relative path
    URL url = SwingImage.class.getClassLoader().getResource( this.container.getXulLoader().getRootDir() + src );

    // Then try to see if we can get the fully qualified file
    if ( url == null ) {
      try {
        File f = new File( src );
        if ( f.exists() ) {
          url = f.toURL();
        }
      } catch ( MalformedURLException e ) {
        // do nothing and let the null url get caught below.
      }
    }

    if ( url == null ) {
      logger.error( "Could not find resource: " + src );
      return;
    }
    ico = new ImageIcon( url );
    if ( ico == null ) {
      logger.error( "Image could not be found: " + ico );
    }
    this.src = src;
    layout();
  }

  public  SwingImage( Element self, XulComponent parent, XulDomContainer domContainer, String tagName );

}