I'm trying to populate a JTree from an array of Objects where A's ObjName is the parent and B's ObjName1 are leaf nodes.
class A {
int a;
String ObjName;
B[] b = new B[10];
A() {
for (int i = 0; i < 10; i++) {
b[i] = new B();
}
}
class B {
String ObjName1;
}
}
I'm using NetBeans IDE. As of Now, I'm only able to place all the objects by hardcoding in the Properties,TreeModel dialog Box of NetBeans.
The Tree is a part of a huger application on JFrame. I've been trying to fit in the above code for two days but haven't succeeded yet. 1.In my situ, is it better to manually code it or use NetBeans? 2. Links/Eg on netbeans wold be great. 3. From what I've read, do I have to create a new data model to populate my Jtree? Thanks so much.