FileDocCategorySizeDatePackage
ObjectTree.javaAPI DocExample1162Thu Oct 24 20:14:26 BST 2002None

ObjectTree

public class ObjectTree extends JFrame

Fields Summary
JTree
tree
String[]
sampleData
Constructors Summary
public ObjectTree()


    
    super("Hashtable Test");
    setSize(400, 300);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
  
Methods Summary
public voidinit()

    Hashtable h = new Hashtable();
    // Build up the hashtable using every other entry in the String[][] as a key
    // followed by a String[]"value."
    for (int i = 0; i < sampleData.length; i+=2) {
      h.put(sampleData[i][0], sampleData[i + 1]);
    }
    tree = new JTree(h);
    getContentPane().add(tree, BorderLayout.CENTER);
  
public static voidmain(java.lang.String[] args)

    ObjectTree tt = new ObjectTree();
    tt.init();
    tt.setVisible(true);