Hashtable h = new Hashtable();
Hashtable paul = new Hashtable();
paul.put("Work", addresses[0]);
paul.put("Home", addresses[1]);
Hashtable damian = new Hashtable();
damian.put("Work", addresses[2]);
damian.put("Pager", addresses[3]);
damian.put("Home", addresses[4]);
Hashtable angela = new Hashtable();
angela.put("Home", addresses[5]);
h.put("Paul", paul);
h.put("Damian", damian);
h.put("Angela", angela);
tree = new JTree(h);
DefaultTreeCellRenderer renderer =
(DefaultTreeCellRenderer)tree.getCellRenderer();
renderer.setOpenIcon(new ImageIcon("mailboxdown.gif"));
renderer.setClosedIcon(new ImageIcon("mailboxup.gif"));
renderer.setLeafIcon(new ImageIcon("letter.gif"));
EmailTreeCellEditor emailEditor = new EmailTreeCellEditor();
DefaultTreeCellEditor editor = new DefaultTreeCellEditor(
tree, renderer, emailEditor);
tree.setCellEditor(editor);
tree.setEditable(true);
getContentPane().add(tree, BorderLayout.CENTER);