I have a JTree
with a MouseListener
for Right-click detection. When the user clicks, I get a MouseEvent
containing the source, the Jtree
.
我有一个带有MouseListener的JTree用于右键单击检测。当用户点击时,我得到一个包含源Jtree的MouseEvent。
How can I get the DefaultMutableTreeNode
right-clicked?
如何右键单击DefaultMutableTreeNode?
I thought about getting the Node at the Point
presented in mouseEvent.getLocationOnScreen()
but I don't know how
我想到在mouseEvent.getLocationOnScreen()中提供的Point处获取Node但我不知道如何
Can you please help me?
你能帮我么?