title: How to update jprogress bar inside jtable
body: <p>i'm developing an app that has a jtable and user could start a download. i want to add in the table the name of download, the state and progress bar. I'm doing like this:</p>
  
  <p>INIT JTABLE: ( CODE CREATED AUTOMATICALLY BY NETBEANS ( is there a way to edit it? o.O ))</p>
  
  <pre><code>jTable1.setModel(new javax.swing.table.DefaultTableModel(
              new Object [][] {
                  {null, null, null},
                  {null, null, null},
                  {null, null, null},
                  {null, null, null}
              },
              new String [] {
                  "Categoria", "Sottocategoria", "Progresso (%)"
              }
          ) {
              Class[] types = new Class [] {
                  java.lang.String.class, java.lang.String.class, java.lang.Object.class
              };
              boolean[] canEdit = new boolean [] {
                  false, false, false
              };
  
              public Class getColumnClass(int columnIndex) {
                  return types [columnIndex];
              }
  
              public boolean isCellEditable(int rowIndex, int columnIndex) {
                  return canEdit [columnIndex];
              }
          });
          jTable1.setColumnSelectionAllowed(true);
          jScrollPane2.setViewportView(jTable1);
          jTable1.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
  </code></pre>
  
  <p>CREATE RENDERER:</p>
  
  <pre><code>class ProgRenderer implements TableCellRenderer {
  
          public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
              return (JProgressBar) value;
          }
      }
  </code></pre>
  
  <p>ADD IT TO THE LAST COLOUM:</p>
  
  <pre><code>jTable1.getColumn("Progresso (%)").setCellRenderer(new ProgRenderer());
  </code></pre>
  
  <p>Now i've created an <code>ArrayList&lt;Thread&gt;</code> to save the active threads, and a <code>ArrayList&lt;JProgressBar&gt;</code> to save all the progressbar existing in jtable ( right way? ).</p>
  
  <p>Now to add new row i make like this:</p>
  
  <pre><code>DefaultTableModel d = (DefaultTableModel) jTable1.getModel();
  work++; // to have a number of active threads.
  progress.add(getProgress(x, total));
  d.addRow(new Object[]{Html.categoria, "Inizio scansione", progress.get(work)});
                  Thread t = new Thread(new Runnable() {
  
                      @Override
                      public void run() {
                          int max = Html.totale;
                          for(int i=1;i&lt;=max;i++){
                              try {
                                  progress.get(work).setValue(i); // JUST FOR TRY
                                  System.out.println(progress.get(work).getValue()); // TRY
                                  Thread.sleep(1000);
                              } catch (InterruptedException ex) {
                          }
                      }
                  });
                  working.add(t);
                  t.start();
  
  
  private JProgressBar getProgress(int x, int total) {
          JProgressBar progressCsv = new JProgressBar();
          progressCsv.setMaximum(total);
          progressCsv.setStringPainted(true);
          progressCsv.setString("0%");
          return progressCsv;
      }
  </code></pre>
  
  <p>My problem is that progress isn't updated, my approach is wrong? can you help me? thanksss</p>