title: How to add an action for a textfield in NetBeans
body: <p>How to add an action for a textfield in NetBeans?</p>
  
  <pre><code>private void totalActionPerformed(java.awt.event.ActionEvent evt) {                                      
      DefaultTableModel model = (DefaultTableModel) billing.getModel();
      model.addRow(new Object[]{code.getText(),itemname.getText(),rate.getText(),qty.getText(),total.getText()});
  
      String a = code.getText(); 
      String b = itemname.getText();
      String c = rate.getText();
      String d = qty.getText();
  
      int x = Integer.parseInt(rate.getText());
      int y = Integer.parseInt(qty.getText());
      int z = x * y;
      String r = String.valueOf(z);
      total.setText(r);
   }
  </code></pre>