The Artima Developer Community
Sponsored Link

Java Answers Forum
Help please

1 reply on 1 page. Most recent reply: Nov 14, 2002 9:01 PM by Dharmendra

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
peter smith

Posts: 1
Nickname: rleona10
Registered: Oct, 2002

Help please Posted: Oct 29, 2002 6:59 PM
Reply to this message Reply
Advertisement
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.

thx in advance


Dharmendra

Posts: 10
Nickname: dh547
Registered: Oct, 2002

Re: Help please Posted: Nov 14, 2002 9:01 PM
Reply to this message Reply
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);

Flat View: This topic has 1 reply on 1 page
Topic: writing to a file Previous Topic   Next Topic Topic: applet not working

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use