title: How can I display a bitmap image in a Java applet?
body: <p>I am having a hard time figuring out how to show an Image (or ImageIcon) in a Java applet. The following is my code.  The picture (test.bmp) does exist and is on the D drive but when I run this I get the applet window with nothing in it.  Can somebody tell me what I am missing to make the ImageIcon show?</p>
  
  <pre><code>public class Form1 extends JApplet {
      ImageIcon i;
  
      public void init(){
          i = new ImageIcon("D:\test.bmp");
      }
  
      public void paint(Graphics g){
          i.paintIcon(this, g, 0, 0);
      }
  }
  </code></pre>
  
  <p>Thanks, Steve.</p>