+ // [Events]
+ class DropTargetAdapterImpl extends DropTargetAdapter {
+ @Override
+ public void drop(DropTargetDropEvent dtde) {
+ Transferable t = dtde.getTransferable();
+ if (t.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
+ dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
+ try {
+ StringBuilder buffer = new StringBuilder();
+ @SuppressWarnings("unchecked")
+ List<File> fileList = (List<File>)t.getTransferData(DataFlavor.javaFileListFlavor);
+ for (File file : fileList) {
+ buffer.append(file.getAbsolutePath()).append(" ");
+ }
+ append(buffer.toString());
+ } catch (UnsupportedFlavorException ex) {
+ throw new RuntimeException(ex);
+ } catch (IOException ex) {
+ throw new RuntimeException(ex);
+ }
+ }
+ }
+ }
+ setDropTarget(new DropTarget(this, new DropTargetAdapterImpl()));