Exemple #1
0
  private String textGen(TreePath p) {

    MyNode selectedNode = (MyNode) p.getLastPathComponent();
    String text = "men allt som";
    int n = selectedNode.getPath().length;

    for (int i = n - 1; i >= 0; i--) {
      text = text + " är " + selectedNode.getPath()[i].toString();
    }
    return text;
  }
    public void nodeAdded(String fqn) {
      MyNode n, p;

      n = root.add(fqn);
      if (n != null) {
        p = (MyNode) n.getParent();
        tree_model.reload(p);
        jtree.scrollPathToVisible(new TreePath(n.getPath()));
      }
    }