title: JTable setValueAt StackOverflowError
body: <p>I've been searching for whole day and I still can't find simple anwser to my problem: <strong>how can I make JTable cell update it's value when I edit it in another one?</strong></p>
  
  <p>I wanted to use somehow <code>fireTableCellUpdated</code> but I don't really understand how can I use it, when and on what object.</p>
  
  <p>What I want is to obtain is some kind of listener that listens whether that values changes or not. In this particular scenario I have editable third column in which I store the amount and I want that listener to automatically calculate and set values in other cells in a row. I've come up with something like this:</p>
  
  <pre><code>@Override
  public void tableChanged(TableModelEvent e)
  {
      BigDecimal withoutTax, tax, withTax;
  
      for(int i = 0; i &lt; table.getRowCount(); i++)
      {
              BigDecimal amount = new BigDecimal(String.valueOf(table.getValueAt(i, 3)).replace(",", "."));
              BigDecimal price = new BigDecimal(String.valueOf(table.getValueAt(i, 4)).replace(",", "."));
              withoutTax = amount.multiply(price, new MathContext(2));
              table.setValueAt(withoutTax, i, 5);
              tax = withoutTax.multiply(new BigDecimal(0.23), new MathContext(2));
              table.setValueAt(tax, i, 7);
              withTax = withoutTax.add(tax, new MathContext(2));
              table.setValueAt(withTax, i, 8);
      }
  }
  </code></pre>
  
  <p>But this results in <code>StackOverflowError</code> and I'm guessing that's because <code>table.setValueAt</code> fires <code>tableChanged</code> listener so it's going into infinite loop.</p>
  
  <p><strong>Can someone explain me how can I accomplish that?</strong></p>