I am doing an assignment. which involves making up a JTable.
In this assignment I read of the names from a text file in the form
name%address%dob%gender
Also in this assignment I have made a Person class which has the variables name, address, dob, gender.
When I read the file I read the details from the text file into an 1D array of Person().
What I want to do is Create a table which automatically reads this group of person() into the table but dont know how to do this as I canbt convert my 1D array into an array of Object[][].
Any help would be greatly appreciated as I have tried everything.
u can use JTable(Vector rowdata,Vector coldata) create a vector and add the rowdata to it Each line is vector and when u go to the second line create anothe vector and the first vector to this.
v1 = new Vector(); v2=new vector(); v1.add();//add the row data. v2.add(v1);