| 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.
|
 |
 |
|
|
subject: get the users input from a column
|
|
|