Invoke action with doubleclick on Jtree node
Answered
I have a JTree with nodes and an action I would like to invoke by double clicking on one of the nodes.
I`ve implemented a MouseListener to check if the user makes a double click on the node.
Now I have the problem that the actionPerformed method which I want to invoke needs an "AnActionEvent". Is there a way to manually create one? Or how can I generally invoke the "actionPerformed" method with another method?
Please sign in to leave a comment.
com.intellij.ide.DataManager#getDataContext(java.awt.Component) to obtain DataContext from current component.
Could you please provide some more information how to do that? What is the "component"?
Thank you in advance!
Any java.awt.Component, e.g. in this case your JTree
Thank you! Now it works.