File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Drag and Drop to Desktop Issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Drag and Drop to Desktop Issue" Watch "Drag and Drop to Desktop Issue" New topic
Author

Drag and Drop to Desktop Issue

Johann Dobbins
Ranch Hand

Joined: Oct 16, 2008
Posts: 62
I have a table component which contains a file representations, which have associated inputstreams. I want to be able to drag a selection of files from this component to the desktop. But when I use the below code, windows informs me that: "Cannot move file, it is being used by another person or program. Close any programs that maybe be using this file and try again".

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Yes, it's that code which is the guilty party. Close the FileOutputStream after you finish writing to it.
Johann Dobbins
Ranch Hand

Joined: Oct 16, 2008
Posts: 62
oops ... thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Drag and Drop to Desktop Issue