// required in order to start dragging a node that is not selected: one click to select
// the node, and then another to start dragging. We install our own DragGestureRecognizer,
// so that dragging can start in just one click, which, IMO, leads to a better user
// experience.
DragSource src = new DragSource();
src.createDefaultDragGestureRecognizer(tree, TransferHandler.COPY, new DragGestureListener() {
@Override
public void dragGestureRecognized(DragGestureEvent dge) {
tree.getTransferHandler().exportAsDrag(tree, dge.getTriggerEvent(), TransferHandler.COPY);
}