I need to get the dropped files' paths. I have implemented the drop(DropTargetDropEvent e) method in my JFrame which implements DropTargetListener which has the following code:
public void drop(DropTargetDropEvent e) {
Transferable tr = e.getTransferable();
e.acceptDrop (DnDConstants.ACTION_REFERENCE);
try {
System.out.println(tr.getTransferData(DataFlavor.getTextPlainUnicodeFlavor()));
} catch (UnsupportedFlavorException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
}
e.getDropTargetContext().dropComplete(true);
}