TreeSet to Array

How I transform a TreeSet into Array[][] .. I neet for JTabel
[68 byte] By [VafCata] at [2007-11-26 14:56:37]
# 1
> How I transform a TreeSet into Array[][] ..Manually. because the placement of the root node is already ambiguous for a 2D array. It's a tree, not a matrix.
CeciNEstPasUnProgrammeura at 2007-7-8 8:45:19 > top of Java-index,Java Essentials,Java Programming...
# 2
ok... only for Array[]... how i transform?
VafCata at 2007-7-8 8:45:19 > top of Java-index,Java Essentials,Java Programming...
# 3
> ok... only for Array[]... how i transform?How about getting an understanding of what you're trying to do first? How do you want your tree to be structured in a table?
CeciNEstPasUnProgrammeura at 2007-7-8 8:45:19 > top of Java-index,Java Essentials,Java Programming...
# 4

I create this TreeSet:

File f=new File("medicamente.txt");

ts=new TreeSet(new Comparatorul());

if (f.exists())

{

try

{

br=new BufferedReader(new FileReader(f));

while ((l=br.readLine())!=null)

{

String[] s=l.split("/");

c=new Medicament(s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7]);

ts.add(c);

}

}catch(IOException ioe){ioe.printStackTrace();}

}

else System.out.println("Fisierul doesn't exist");

after this i want to make "ts" into "Array"

and after this create the JTabel:

table = new JTable( Array, columnNames );

VafCata at 2007-7-8 8:45:19 > top of Java-index,Java Essentials,Java Programming...
# 5
Medicament[] array = ts.toArray(new Medicament[ts.size()]);
prometheuzza at 2007-7-8 8:45:19 > top of Java-index,Java Essentials,Java Programming...
# 6
> Medicament[] array = ts.toArray(new> Medicament[ts.size()]);Which might or might not be in the order the OP needs. That's why I asked.
CeciNEstPasUnProgrammeura at 2007-7-8 8:45:19 > top of Java-index,Java Essentials,Java Programming...
# 7
> Which might or might not be in the order the OP> needs. That's why I asked.Yeah, sorry about that Rene. After reading the OP's 3 posts, I was (or am) under the impression the OP wasn't interested in understanding it.
prometheuzza at 2007-7-8 8:45:19 > top of Java-index,Java Essentials,Java Programming...
# 8
> Yeah, sorry about that Rene.No worries. Your solution is a solution after all. Maybe it suffices.> After reading the OP's 3> posts, I was (or am) under the impression the OP> wasn't interested in understanding it.Same here. :)
CeciNEstPasUnProgrammeura at 2007-7-8 8:45:19 > top of Java-index,Java Essentials,Java Programming...