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. Advertisements

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. wolf
    Replies:
    0
    Views:
    669
  2. Replies:
    0
    Views:
    1,915
  3. Replies:
    0
    Views:
    488
  4. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,605
  5. Tjerk Wolterink
    Replies:
    2
    Views:
    1,719
    Dimitre Novatchev
    Aug 24, 2006
  6. Jason Cavett

    Renaming JTree Node and Listeners

    Jason Cavett, Feb 8, 2007, in forum: Java
    Replies:
    0
    Views:
    1,131
    Jason Cavett
    Feb 8, 2007
  7. Peter Mueller
    Replies:
    6
    Views:
    5,225
    Stefan Ram
    Jan 13, 2008
  8. 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:
    405
    John Bankhead
    Dec 4, 2006
Loading...