title: Relative path in JLabel HTML
body: <p>I am trying to make JLabel show an html which is referencing an image using a relative path.
  But I cannot make JLabel locate the image. It works fine when I am using absolute path.</p>
  
  <p>I have tried running the program from the command line or from eclipse and add dialog to show me where is the current working directory but for avail.
  I have therefor came to the conclusion that the image is not searched in the current directory - which brings me to the point. where is the image looked for?</p>
  
  <p>here is a test code that show what I am doing:</p>
  
  <pre><code>import javax.swing.*;
  
  public class HTMLLabel extends JFrame {
      public HTMLLabel() {
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  
          JOptionPane.showMessageDialog( this, 
                  System.getProperty("user.dir"));
  
           String html = "&lt;html&gt;\n" +
          "   &lt;body&gt;\n" +
          "       &lt;div style=\"text-align: center;\"&gt;\n" + 
          "           &lt;img src=\"file://s.png\"&gt;\n"+
          "       &lt;/div&gt;\n"+
          "   &lt;/body&gt;\n"+
          "&lt;/html&gt;";
  
           JLabel label = new JLabel(html);
           add(label);
  
           pack();
           setVisible(true);
      } 
  
      public static void main(String[] args) {
           new HTMLLabel();
      }
  }
  </code></pre>