title: JTable get all rows that are being edited
body: <p>I have a JTable which has 2 columns </p>
  
  <ul>
  <li>column 0 username</li>
  <li>column 1 password.</li>
  </ul>
  
  <p>for the password column it will be encrypted to SHA256.</p>
  
  <p>Basically what I want to achieve is it will update all the rows in my password column to SHA256 that I have edited after my button is pressed.</p>
  
  <p>so..</p>
  
  <p>I have a RowData class, this will store the text being edited and the position of the text
  being edited(rows,columns).  </p>
  
  <pre><code>public class RowData {
      int rows = 0, columns = 0;
      String text = " ";  
      public RowData(String text,int rows, int columns) {
          setEditedRows(rows);
          setEditedColumns(columns);
          setEditedText(text);
      }
  
      public int getEditedRows() {
          return rows;
      }
  
      public int getEditedColumns() {
          return columns;
      }
  
      public String getEditedText() {
          return text;
      }
  
      public void setEditedRows(int rows) {
          this.rows = rows;
      }
  
      public void setEditedColumns(int columns) {
          this.columns = columns;
      }
  
      public void setEditedText(String text) {
          this.text = text;
      }
  }
  </code></pre>
  
  <p>I wrote a TableModelListener.. I have an List to store the text and the rows and columns
  after the table has changed </p>
  
  <pre><code> table.getModel().addTableModelListener(new TableModelListener() {
              @Override
              public void tableChanged(TableModelEvent e) {
                  int row = e.getFirstRow();
                  int column = e.getColumn();
                  TableModel model = (TableModel) e.getSource();
                  //System.out.println(model.getValueAt(row, column));
                  if(column == 1) {
                      String data = (String) model.getValueAt(row, column);
                      System.out.println(data);
                      dataList.add(new RowData(data,row,column));
                  }
  
              }
          });
  </code></pre>
  
  <p>In my button I loop through the list and retrieve the rows, and columns and text
  and set the password to SHA256 to the JTable.</p>
  
  <pre><code>updateBtn.addActionListener(new ActionListener(){
          public void actionPerformed(ActionEvent e) {
              if (table.getCellEditor() != null) {
                  table.getCellEditor().stopCellEditing();    
                  for(int i = 0; i &lt; dataList.size(); i++) {
                      String text = dataList.get(i).getEditedText();
                      int rows = dataList.get(i).getEditedRows();
                      int columns =  dataList.get(i).getEditedColumns();
                      //System.out.println(dataList.get(i).getEditedText() + " " +  dataList.get(i).getEditedRows() + dataList.get(i).getEditedColumns());
                      table.setValueAt(convertPassword.convertToSHA256(text), rows ,columns);
                  }
              }
          }
      }); 
  </code></pre>
  
  <p>The result I get is I will keep printing the password endlessly in my console.
  So I think that my logic is wrong and needed to be corrected.</p>