move nodes up or down in a JTree/TreeModel?

From: Tim (no_at_thanx.please)
Date: 08/23/04

  • Next message: ak: "Re: move nodes up or down in a JTree/TreeModel?"
    Date: Mon, 23 Aug 2004 13:07:56 GMT
    
    

    Hi,

    no info found with google, but I hope anyone here has experience with
    changing a JTree / TreeModel. What I want, is to move a node, with his
    children of course, up or down the tree one place, when the up/down button
    is pressed. I have some experience with adding nodes and deleting now, but
    the only sollution I see, is rather radical: deleting all nodes after the
    one to move down, adding the one after the selected node, adding the node
    itself again and then adding the rest (for moving down), similar algorithm
    to move up. Are there any better solutions to this?

    TIA,
    Tim


  • Next message: ak: "Re: move nodes up or down in a JTree/TreeModel?"