Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within I/O and Streams
Search Coderanch
Advance search
Google search
Register / Login
Forums
Register
Login
Java
»
I/O and Streams
Detect copying file
Udaya Wijenayake
,
Ranch Hand
May 25, 2010 00:27:19
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
When i copied a file in my system (using ctrl+c or right click) i want to detect its file name using a
Java
code. Is there any supporting class/method to do that ??
Rob Spoor
,
Sheriff
staff
May 25, 2010 01:05:57
(0 cow)
(0 skulls)
+Pie
Number of slices to send:
Send
Check out java.awt.datatransfer.Clipboard. In short:
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); DataFlavor flavor = DataFlavor.javaFileListFlavor; if (clipboard.isDataFlavorAvailable(flavor)) { List<File> files = (List<File>)clipboard.getData(flavor); // yes, multiple files! }
Post by:
autobot
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
This thread has been viewed 709 times.
Similar Threads
hibernate properties
java redirection
Capture browser close
How to detect the end of file
Checking for EOF
More...
All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 05:16:22
.