Skip to content

Commit

Permalink
Fix Drag and drop of file by first converting to File and then to path (
Browse files Browse the repository at this point in the history
#2764)

Fix for #2760
  • Loading branch information
Siedlerchr authored Apr 20, 2017
1 parent bd8d1ee commit 9134777
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

import javax.swing.JComponent;
import javax.swing.JTable;
Expand Down Expand Up @@ -118,7 +119,8 @@ public boolean importData(JComponent comp, Transferable t) {
// JOptionPane.showMessageDialog(null, "Received
// javaFileListFlavor");
@SuppressWarnings("unchecked")
List<Path> files = (List<Path>) t.getTransferData(DataFlavor.javaFileListFlavor);
List<Path> files = ((List<File>) t.getTransferData(DataFlavor.javaFileListFlavor)).stream()
.map(File::toPath).collect(Collectors.toList());
return handleDraggedFiles(files, dropRow);
} else if (t.isDataFlavorSupported(urlFlavor)) {
URL dropLink = (URL) t.getTransferData(urlFlavor);
Expand Down

0 comments on commit 9134777

Please sign in to comment.