title: JAVA: Put Image in jTable Cell
body: <p>I need to display an image in one of jTable cells.<br>
  I wrote this:  </p>
  
  <pre><code>class ImageRenderer extends DefaultTableCellRenderer {
      JLabel lbl = new JLabel();
  
      public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
          boolean hasFocus, int row, int column) {
          lbl.setText((String) value);
          lbl.setIcon(new ImageIcon("/home/ariyan/Desktop/71290452.jpg"));
          return lbl;
      }
  }
  </code></pre>
  
  <p>and then used it as this:</p>
  
  <pre><code>    jTable1.getColumn(0).setCellRenderer(new ImageRenderer());
  </code></pre>
  
  <p>But this didn't work<br>
  How I can do that?  </p>
  
  <p>Thanks</p>