dse.getDragSourceContext().setCursor(DragSource.DefaultMoveNoDrop);
}
/* Methods for DragGestureListener */
public final void dragGestureRecognized(DragGestureEvent dge) {
TreePath path = tree.getSelectionPath();
if (path != null) {
draggedNode = path.getLastPathComponent();
if (drawImage) {
Rectangle pathBounds = tree.getPathBounds(path); // getpathbounds
// of
// selectionpath
JComponent lbl = (JComponent) tree
.getCellRenderer()
.getTreeCellRendererComponent(
tree,
draggedNode,
false,
tree.isExpanded(path),
tree.getModel() .isLeaf(path.getLastPathComponent()),
0, false);// returning the label
lbl.setBounds(pathBounds);// setting bounds to lbl
image = new BufferedImage(lbl.getWidth(), lbl.getHeight(),
java.awt.image.BufferedImage.TYPE_INT_ARGB_PRE);// buffered
// image