title: Java JTable changing icon in cell
body: <p>This has been asked a million times it appears, but I must be feeling especially dense tonight because I'm still having trouble. My first question is this, when I call </p>
  
  <pre><code>ImageIcon icon = new ImageIcon(getClass().getResource("images/x.jpg"));
  </code></pre>
  
  <p>where is it looking for the images folder? I've tried making it a folder under my project and under src. What am I missing? I'm using Eclipse. As you've probably guessed already, I haven't done much Java.</p>
  
  <p>What I really want to do is to set the the first column in a table to an initial icon and then allow the user to double click on it and change the icon. Could someone be so kind as to gently push (or violently shove) me in the right direction? Do I need my own renderer class? </p>
  
  <pre><code>class MyRenderer extends DefaultTableCellRenderer {
  ....
  </code></pre>
  
  <p>When someone double clicks on the row I want to change the icon to y.jpg. </p>
  
  <p><strong>Edited</strong>
  Thanks for the help. Another dumb question. Should I see the icon when I add a row like this?</p>
  
  <pre><code>DefaultTableModel dm = (DefaultTableModel)tblNews.getModel();
  ImageIcon icon = new ImageIcon(getClass().getResource("/x.jpg"));
  dm.addRow(new Object[]{icon, "Text"});
  </code></pre>
  
  <p>I see the filename of the icon, but not the icon itself.</p>