I found the following code:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
DefaultTableModel tableModel = new DefaultTableModel();
JTable table = new JTable();
table.setModel(tableModel);
int c=0;
Vector rl=new Vector<Object(6);
rl.add(c+1);
rl.add(jTextField1.getText());
rl.add(jTextField11.getText());
rl.add(jTextField7.getText());
rl.add(jTextField8.getText());
rl.add(jTextField9.getText());
tableModel.addRow(rl);}
But it's not working.
I have to copy the fields corresponding to pcode, product name, price, Quantity, total price which are the textfields, when I click add button to the table given in it