How to copy files to system clipboard?
What i have so far is an array list containing Files (File filename =new File(path)). It's made up of different kinds of files, from videos to documents.
How do i send the contents of the arraylist to the system clipboard so I can paste them somewhere in my system?
Re: How to copy files to system clipboard?
Construct a Transferable with a javaFileListFlavor DataFlavor and the list of files as the data. Get the System clipboard and set its contents with this data flavor. There are several code examples for how to copy to the Clipboard. Most do so using String flavors but the jist is the same. Take a look at the following classes:
Transferable (Java Platform SE 6)
DataFlavor (Java Platform SE 6)