Copying the Filename Path from a JFileChooser Dialog to the Clipboard

Typing control-c in a file chooser dialog copies the names of the selected files to the clipboard. If there is only a single selected file, the absolute path of the file is copied to the clipboard. Here is an example:
C:\Documents and Settings\Administrator\Start Menu\Programs\Internet Explorer.lnk
If there are multiple selected files, the absolute paths of the selected files are wrapped in HTML code and copied to the clipboard. Here is an example of the HTML code:
<html><ol> <li>C:\Documents and Settings\Administrator\Start Menu\Programs\Internet Explorer.lnk <li>C:\Documents and Settings\Administrator\Start Menu\Programs\MSN Messenger Service.lnk <li>C:\Documents and Settings\Administrator\Start Menu\Programs\Outlook Express.lnk <li>C:\Documents and Settings\Administrator\Start Menu\Programs\Windows Media Player.lnk </ol></html>

Post a comment

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.