title: updating jTable row if record is already present
body: <p>I am working on invoice and have added jTable to my frame for multiple items, like I have 4 fields for user "item, quantity, rate, price" and user fills it all and click on add button then these fields are added to jTable with item id inlcuded. </p>
  
  <p>now the problem I am facing when user enters the same item whereas that item is already added in the list and it duplicates the row in jTable.</p>
  
  <p>All i want to update that row if the item is same, update its quantity field with adding new quantity value and price value.</p>
  
  <p>i.e. </p>
  
  <pre><code> id  |Item  |qty|   rate|   Price|
   --------------------------------------
   12  |saee  |3  |    300|    900 |
  </code></pre>
  
  <p>now if user enters the same item with 5 quantity, it should update same item or row with plus quantity and price like.</p>
  
  <pre><code>--------------------------------------
  id  |Item   |qty|   rate|   Price|
  --------------------------------------
  12  |saee   |8  |    300|   24000|
  </code></pre>
  
  <p>but instead of this, it adds a second row in jTable. </p>
  
  <p>here is my code for adding items in to jTable</p>
  
  <pre><code> DefaultTableModel model = (DefaultTableModel) tbl_sale.getModel();
   model.addRow(new Object[]{lbl_id.getText(), txt_item.getText(), txt_qty.getText(), txt_rate.getText(), txt_rs.getText()});
  </code></pre>
  
  <p>can anyone tell me what should i do?</p>