// Open the file with its path copied to the clipboard // Author: AhLeung Cheng https://plus.google.com/+AhLeungCheng // GNU General Public License String path = java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().getData(java.awt.datatransfer.DataFlavor.stringFlavor).trim(); // ref: http://stackoverflow.com/questions/7105778/java-get-pure-text-from-clipboard if (path!=null) { File f = new File(path); if (f.exists()) jEdit.openFile(view, path); else view.getStatus().setMessageAndClear("File \"" + path + "\" doesn't exist."); }