Results 1 to 2 of 2
  1. #1
    Reptar693 is offline Member
    Join Date
    Mar 2012
    Posts
    6
    Rep Power
    0

    Default 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?

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,641
    Rep Power
    7

    Default 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)

Similar Threads

  1. Replies: 5
    Last Post: 02-08-2012, 02:17 PM
  2. copy actual window to clipboard
    By greenhorn in forum New To Java
    Replies: 10
    Last Post: 04-01-2011, 02:18 PM
  3. Help!! Copy JTextField to clipboard!
    By goffy in forum New To Java
    Replies: 6
    Last Post: 05-01-2010, 07:37 PM
  4. Copy from Clipboard in japplet
    By AZMichael in forum Java Applets
    Replies: 3
    Last Post: 09-06-2008, 02:30 PM
  5. How to copy and paste data with the clipboard
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-07-2008, 04:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •