0

this is my code. what happens is when i select a record and click on a button that record is added to all the fields. Thus im not able to feed more than 1 row in my jtable. i want to enter the data and then change the row so that more data can be entered. i know i am doing something wrong, i just cant find it out.

public void gencode(String a1, String a2, String a3,String a4, String a5){
    int i=0;
    for(i=0;i<15;i++)
    {
       jTable1.setValueAt(a1, i, 0);
       jTable1.setValueAt(a2, i, 1);
       jTable1.setValueAt(a3, i, 2);
       jTable1.setValueAt(a4, i, 3);
       jTable1.setValueAt(a5, i, 4);
    }
}
Madhawa Priyashantha
  • 9,633
  • 7
  • 33
  • 60
Anmol Khanna
  • 95
  • 2
  • 9

0 Answers0