import java.awt.BorderLayout;
import java.util.Vector;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTree;
class TreeNodeVector extends Vector {
String name;
TreeNodeVector(String name) {
this.name = name;
}
TreeNodeVector(String name, E elements[]) {
this.name = name;
for (int i = 0, n = elements.length; i < n; i++) {
add(elements[i]);
}
}
public String toString() {
return "[" + name + "]";
}
}
public class TreeArraySample {
public static void main(final String args[]) {
JFrame frame = new JFrame("JTreeSample");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Vector v1 = new TreeNodeVector("Two", new String[] { "Mercury", "Venus",
"Mars" });
Vector