Skip to main content

JTreeTable: tree cell editor/renderer location

No replies
Joined: 2003-07-15

I have implemented drag and drop functionality in the JTreeTable and at the time of dropping, I open up a popup to provide various options (similar to the copy, move, shortcut options available in Explorer). I use the TransferHandler for the drag and drop functionality and unfortunately the TransferHandler doesn't provide the drop location (I mean the mouse point). However, since I know the drop node, I am wondering if there is a way to get the x,y location of the cell renderer/editor of the tree node. Right now I use the getCellRect(row,column) to find the coordinates, but that doesn't take the tree sturcture into account. So, for now, I am using something like

cellrect.x+ 25*node.getLevel()

but this is some what a hack.