aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes MouseListener and a Jtree� Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "MouseListener and a Jtree�" Watch "MouseListener and a Jtree�" New topic
Author

MouseListener and a Jtree�

Pat Peg
Ranch Hand

Joined: Feb 04, 2005
Posts: 194
I have a drag and drop JTree that implements DragGestureListener, DragSourceListsner and DropTargetListener. I am trying to add a MouseListener so when a person executes a right-click they can get some data from the nodes of the tree.

I guess my question is where do I implement the MouseListener? I have tried doing so in my DataNode (an extended DefaultMutableTreeNode) and in my tree (an extended JTree) as well as in my abstract classes handling the DnD function.

Nothing I have tried so far seems to register any mouse event. In fact, the tree continues to function with it�s DnD abilities.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MouseListener and a Jtree�