aspose file tools
The moose likes Swing / AWT / SWT and the fly likes get the users input from a column Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "get the users input from a column" Watch "get the users input from a column" New topic
Author

get the users input from a column

dave vanweed
Greenhorn

Joined: Feb 06, 2003
Posts: 6
I have to columns on my JTable (first name , lastname).
Hello
How can i loop though each column the first column (first names) and get each row and add it to a String array? for example if the user puts in 10 firstnames i want to add all 10 to a string array.
and for the second column i want to add all the rows (last names ) to a arraylist. so if the user puts in 10 lastnames i want to add them to a arraylist.
How can i do this?
thanks
davey
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1114

Hi Davey,
I may be misunderstanding your question, but I think the easiest way is to get the data from the "JTable"'s associated "TableModel". Use the "JTable" method "getModel()" to retrieve the "TableModel", then use the "getValueAt()" method (of "TableModel") to get the required data. Please see the relevant documentation (javadocs) for more details.
Hope this helps.
Good Luck,
Avi.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: get the users input from a column
 
Similar Threads
Printing the contents of a Vector
combining two classes
<identifier> expected
SortNames
commit() and rollback() problem!