title: Update Icon in JTable after user input
body: <p>I need to update an icon in <code>JTable</code> after the user digit a number in a <code>JTextField</code>.</p>
  
  <p>Step-by-Step:</p>
  
  <ul>
  <li>The user clicks in a <code>JTable</code> row, and after that, opens a <code>JFrame</code> to edit its contents.</li>
  <li>There is a <code>JTextField</code> in that <code>EditFrame</code> where the user put a number from 0 to 100. That number will change the icon being displayed in my JTable row after the user close <code>EditFrame</code>.</li>
  </ul>
  
  <p>I read the <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/table.html#editrender" rel="nofollow">documentation here</a>.I changed my aproach.I killed the renderer and created static Icons in my Meal class and created a method like that:</p>
  
  <pre><code>  public ImageIcon getIconByValue(int value){
      if(value==0)
          return ONESTAR;
      else
          return ...;     
  }
  </code></pre>
  
  <p>and made some changes in my tablemodel(to store a ImageIcon):</p>
  
  <pre><code>  public Class&lt;?&gt; getColumnClass(int columnIndex) {  
      switch (columnIndex) {  
    case RATING:  
     return ImageIcon.class;    
  ...} 
      public void setValueAt(Object aValue, int rowIndex, int columnIndex) {  
         //..other cases....//  
          case RATING:            
                  meal.getIconByValue((int)aValue);  
                  break;
  }
   public void setData(List&lt;Meal&gt; list){  
      this.meals.clear();  
       for(Meal m:list){  
         Meal meal=new Meal();  
      //...other sets..//  
        meal.getIconByValue(m.getRating());  
    }  
    this.meals.add(meal); 
   }
  </code></pre>
  
  <p>But my Rating space(where should show the stars), is totally blank. 
  Note: I read other topics too, but none of the helps how to change icons OnTheFly in a <code>JTable</code>.</p>