Renaming a Tree Node

Discussion in 'Java' started by Jason Cavett, Jan 29, 2007.

  1. Jason Cavett

    Jason Cavett Guest

    I am currently renaming a tree node by firing off an event when the
    user right clicks on the node and clicks "Rename" on the popup menu.
    This works fine. The problem is, I want to be able to check the
    string before I allow the name change to take place. This is the
    method that is called when I fire off the Rename event.


    /**
    * Rename a node in the tree.
    */
    public void renameTreeNode() {
    this.setEditable(true);
    TreePath path = this.getSelectionPath();
    this.startEditingAtPath(path);
    }

    Problem is, this must fire off some sort of tree event or something
    that I can't figure out. So, there doesn't appear to be a way for me
    to get the input that the user typed in until after the fact. Can
    anybody provide any insight.

    Thanks
     
    Jason Cavett, Jan 29, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    1,669
  2. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,242
  3. Tjerk Wolterink
    Replies:
    2
    Views:
    1,520
    Dimitre Novatchev
    Aug 24, 2006
  4. Peter Mueller
    Replies:
    6
    Views:
    4,713
    Stefan Ram
    Jan 13, 2008
  5. John Bankhead

    Null parent node on custom tree node after populate on demand

    John Bankhead, Dec 4, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    304
    John Bankhead
    Dec 4, 2006
Loading...

Share This Page