title: text field in jTable something better than ActionPerformed(java.awt.event.ActionEvent evt)!
body: <p>hi guys hope you all well.. to day i have a question again i am using a text field in jTable to edit a column and i use 
  <code>model.getValueAt();</code> from a column and <code>model.setValueAt();</code> to another column after doing some calculations fanaly when i press enter key the action replays but sometimes does not reply and does not update changing so i have to press again...  my code looks something like this: </p>
  
  <pre><code>private void txt_ActionPerformed(java.awt.event.ActionEvent evt){
   try {
          int viewRow = table.getSelectedRow();
          String id = (table.getModel().getValueAt(viewRow, 1).toString());
  
          String sql1 = "SELECT * FROM mydb.mytable_1 where ID1='"+id1+"'";
          dm.pst = dm.c.prepareStatement(sql1);
          dm.rs = dm.pst.executeQuery();
          if (dm.rs.next()) {
          float a = dm.rs.getFloat("mycolumn_1");
          float b = Float.parseFloat(model.getValueAt(viewRow, model.getColumnCount()-10).toString());
          float c = Float.parseFloat(model.getValueAt(viewRow, model.getColumnCount()-9).toString());
          String d = model.getValueAt(viewRow, model.getColumnCount()-8).toString();
  
          float e = 0;
          switch (d) {
              case "U":case "1":e = 0;break;
              case "W":case "2":e = 7;break;
              case "X":case "3":e = 10;break;
              case "Y":case "4":e = 14;break;
              case "Z":case "5":e = 20;break;
              default:System.err.println("Error..");break;
          }
          if(b&gt;a){
  
              JOptionPane.showMessageDialog(null, "B is Bigger than A..!!");
          }else if(a&gt;=b){
  
            float val_1 = a-b
            float val_2 = b * c;
            float val_3 = b * (((e / 100) + 1) * c);
          model.setValueAt(val_3, viewRow, model.getColumnCount()-6); 
          model.setValueAt(val_2, viewRow, model.getColumnCount()-7); 
          model.setValueAt(val_1, viewRow, model.getColumnCount()-11); 
          String id2 = (table.getModel().getValueAt(viewRow, 0).toString());
          String upid = "update mydb.mytable_2 set mycolumn_2='" + b + "'where ID2='" + id2 + "'";
          dm.pst = dm.c.prepareStatement(upid);
          dm.pst.execute();
          }
      }
  
      } catch (Exception ex) {
          JOptionPane.showMessageDialog(null, ex);
      }
  </code></pre>
  
  <p>}</p>
  
  <p>anything else better than action performed?
  Note: after i edited my code i would say that i am using <code>JTextField txt_ = new JTextField();</code> as an editor for my column and i am using <code>model = new DefaultTableModel()</code>
  thank in advance</p>