Hallo,
ich möchte gerne einen JTree populieren, aber irgendwie komme ich nicht weiter.
Ich habe einen Vector mit den Objekten, die im Jtree dargestellt werden sollen. Die Objekte im Vector sind schon nach hierarchie-ebene sortiert. (Ich bin nach dieser Beschreibung vorgegangen). Der Inhalt des Vectors sieht dann so aus:
[Blockierte Grafik: http://www.klempert.de/nested_sets/tab2.png]
Jetzt weiß ich leider nicht, wie ich diese hierarchie am besten in den JTree bekomme.
Dafür gibt es doch bestimmt einen (rekursiven) Algorithmus, oder?
Könnt ihr mir ein paar Tipps oder Links zu Referenzimplementierungen geben? Würde mich sehr darüber freuen.
ich möchte gerne einen JTree populieren, aber irgendwie komme ich nicht weiter.
Ich habe einen Vector mit den Objekten, die im Jtree dargestellt werden sollen. Die Objekte im Vector sind schon nach hierarchie-ebene sortiert. (Ich bin nach dieser Beschreibung vorgegangen). Der Inhalt des Vectors sieht dann so aus:
[Blockierte Grafik: http://www.klempert.de/nested_sets/tab2.png]
Jetzt weiß ich leider nicht, wie ich diese hierarchie am besten in den JTree bekomme.
Dafür gibt es doch bestimmt einen (rekursiven) Algorithmus, oder?
Könnt ihr mir ein paar Tipps oder Links zu Referenzimplementierungen geben? Würde mich sehr darüber freuen.