private void initDragAndDrop() {
        smartFolderTree.setDropTarget(new DropTarget() {
            @Override
            public synchronized void drop(DropTargetDropEvent dtde) {
                try {
                    Transferable transfer = dtde.getTransferable();

                    if (transfer.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
                        dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
                        List objects = (List) transfer.getTransferData(DataFlavor.javaFileListFlavor);
                        for (Object object : objects) {
                            if (object instanceof File) {
                                File source = (File) object;
                                if (source.isDirectory()) {
                                    DirectoryMonitor.registerDirectory(source);
                                }
                            }
                        }
                    }
                } catch (IOException | UnsupportedFlavorException e) {
                } finally {
                    dtde.dropComplete(true);
                }
            }
        });
    }