protected static List<File> transferableToFileList(Transferable t) {
        try {
            List<File> files = new LinkedList<File>();
            if (t.isDataFlavorSupported(DataFlavor.stringFlavor)) {
                String data = (String) t.getTransferData(DataFlavor.stringFlavor);
                BufferedReader buf = new BufferedReader(new StringReader(data));
                String line;
                while ((line = buf.readLine()) != null) {
                    if (line.startsWith("file:/")) {
                        line = line.substring("file:/".length());
                        files.add(new File(line));
                    } else {
                        System.out.println("Not sure how to read: " + line);
                    }
                }
                return files;
            } else if (t.isDataFlavorSupported(DataFlavor.javaFileListFlavor)) {
                List data = (List) t.getTransferData(DataFlavor.javaFileListFlavor);
                Iterator i = data.iterator();
                while (i.hasNext()) {
                    files.add((File) i.next());
                }
                return files;
            }
            return null;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }