jtable creation inporting values from array list

Hi i have created an array list and would like to show all results in an jtable, i have been given the following link http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

i have 2 fields in my arraylist name and location

code on the site modified to mines is

String[] columnNames ={"Name",

"Location"};

Object[][] data ={

XXXXX

};

JTable table =new JTable(data, columnNames);

wwhat would i write in xxxxxx, i dnt want to write the values but a line which will collect all data from the arraylist if you get what i mean, does this help?

[811 byte] By [javaking312a] at [2007-11-26 13:36:30]
# 1

> wwhat would i write in xxxxxx, i dnt want to write

> the values but a line which will collect all data

> from the arraylist if you get what i mean, does this

> help?

Loop through your arrayList. For each object create an array of what you want the row for that object to look like. Add that array to your data variable.

zadoka at 2007-7-7 22:22:00 > top of Java-index,Desktop,Core GUI APIs...