i am trying to make simple drag and drop in the TreeView between TreeViewItems. i have attached a MouseListener to the TreeView to check change the cursor and validate the dragging.
My problem is to define where in the TreeView i am during the dragging, because in some cases the dragging should not be allowed depending on the initial (item to drag)item and the item i’m over with the cursor.
To identify where i am in the treeView during the drag and drop i try to use getPositionWithinTreeView
but the Rectangle always gives me the initial position of the teeItem.
If i scroll the treeView this position is not the correct rectangle of the treeItem, because it still gives back the treeViewItem’s original rectangle
Is there a more effective way to define the possible destination TreeViewItem or there is an other way then getPositionWithinTreeView to identify the TreeViewItem im am over with the mouse