title: Java adding ImageIcon to JLabel
body: <p>I am trying to make a very basic game with Java and I am having trouble displaying an image on a <code>JFrame</code>. It has worked in the past for me and now is not, i can't see what I did wrong.</p>
  
  <p>I have tried printing the current working directory and changing where I get my image to match that. It is likely that the problem is not getting the image, since my (filefinder or filereader or something like that) can find it without problems, but I cannot correctly add it (the <code>ImageIcon</code>) to the <code>JLabel</code>, or that to the <code>JFrame</code>.</p>
  
  <p>This is my code...</p>
  
  <pre><code>JFrame frame = new JFrame("no image");
  ImageIcon image = new ImageIcon("C:/Documents and Settings/user/Desktop/hi/xD/JavaApplication2/image.png");
  JLabel imagelabel = new JLabel(image);
  frame.add(imagelabel);
  </code></pre>
  
  <p>The <code>JFrame</code> has been <code>setVisible(true)</code> and <code>pack()</code>.</p>
  
  <p>Could someone please help me understand what is wrong.</p>