@Override
  public void drop(DropTargetDropEvent dtde) {
    pFilesContainer.setBorder(BorderFactory.createEmptyBorder());
    pFilesContainer.remove(dropInfo);
    pFilesScroll.setVisible(true);
    try {
      Transferable tr = dtde.getTransferable();
      DataFlavor[] flavors = tr.getTransferDataFlavors();
      for (int i = 0; i < flavors.length; i++) {
        //System.out.println("Possible flavor: " + flavors[i].getMimeType());
        if (flavors[i].isFlavorJavaFileListType()) {
          dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
          array = new ArrayList<File>();
          @SuppressWarnings("unchecked")
          List<File> list = (List<File>) tr.getTransferData(flavors[i]);

          for (File f : list) {
            if (Data.settings.loadSubdirectory) {
              addToArray(f);
            } else {
              if (f.isDirectory()) {
                array.addAll(Arrays.asList(f.listFiles()));
              }
              if (f.isFile()) {
                array.add(f);
              }
            }
          }
          addImages(array);
          dtde.dropComplete(true);
          return;
        } else if (flavors[i].isRepresentationClassInputStream()) {
          dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
          dtde.dropComplete(true);
          return;
        }
      }
      dtde.rejectDrop();
    } catch (Exception e) {
      dtde.rejectDrop();
    }
  }