It looks like the JTable
construct likes String[][]
... but I like to use smarter containers until I have to use something else. been using ArrayList<ArrayList<String>>
, now I need to make JTable
happy with String[][]
.
I found a real easy way to convert an ArrayList<String>
to a String[]
using toArray()
, but not finding the easy converter for multidimensional arrays.
I want to go from ArrayList<ArrayList<String>>
to String[][]
in the least number of lines.
I have been searching the library and cannot seem to find this converter, and hoping someone could suggest a good solution for this.
Thanks in advance.
> matrixString`. I mean you should use the `List` instead of `ArrayList` to declare the variable. And the answer of Robert Rouhani is fine.
– May 15 '12 at 03:10