swing - Triggering Tree Cell Edit Event
问题 I have a JTree with editable nodes. How can I programmatically trigger the tree cell edit event, i.e. bring up the node-renaming textbox in place of a highlighted node, as if the user manually highlighted it and pressed F2? Basically I want to add a "Rename" menu item or toolbar button, to clue users in on that particular function of the tree, and I want it to function identically to an F2 keypress when the user highlights a node. 回答1: 1) some node is selected (by Mouse / KeyBoard event) and