title: Adding value on a Jtable column
body: <p>I want to add how many items in the unit count and compute it in the total cost.</p>
  
  <p><img src="https://i.stack.imgur.com/LKfts.png" alt="enter image description here"></p>
  
  <pre><code>private void display()
  {
      DefaultTableModel model= (DefaultTableModel)SupplyRSTable.getModel();
          SupplyRSTable.revalidate();
          model.getDataVector().removeAllElements();
          try{
  
           stmt = conn.createStatement();
       stmt.executeQuery("SELECT itemcode,itemname,itemgroup,itemcost FROM supplytable");
       rs = stmt.getResultSet();
          while (rs.next()) 
          {
                      String r1 = rs.getString("itemname");
                      String r2 = rs.getString("itemgroup");
                      String r3 = rs.getString("itemcost");
                      String r4 = rs.getString("itemcode");
                     model.addRow(new Object[] {r4,r1,r2,r3}); 
                     SupplyRSTable.revalidate(); 
  
          }
          }
          catch(Exception e)
          {
              JOptionPane.showMessageDialog(null, e.getMessage());
          }`
  </code></pre>
  
  <p>I only have a display</p>