Disabling 3-Click Edit of a JTree node but keeping keyoard keys to edit for saving the old name of the node prior to edit
问题 I want to be able to edit the nodename with F2 and ENTER keys only, not with mouse. I added these 2 lines and they are working: jTree1.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "startEditing"); jTree1.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0), "startEditing"); But how do I disable editing from mouse? Are there any methods like: jTree1.setToggleClickCount(2); The reason I want to do this is that I want to keep the old name of the node, so I'll create a