Drag Files to OS

Drag a file from java to an OS

Page 1 of 1

3 Replies - 1210 Views - Last Post: 06 February 2010 - 06:04 PM Rate Topic: -----

#1 Guest_painkiller102*


Reputation:

Drag Files to OS

Posted 06 February 2010 - 02:36 PM

I have posted this before, and after a good month of searching around i am still coming up with absolutely nothing. My program holds all the files that you drag to it. So if i dragged a file : "C:/User/Painkiller/image.png" to my program, it would now hold that file and show it on a GUI. I now want to add a feature that you can drag the file BACK onto the OS (WinXP, Vista, or Win7 compatible, don't much care about MacOS). Think of it kind of like windows explorer, your looking threw a folder "C:/Temp/" and you find a file "C:/Temp/exp.png", you then can drag that file from "C:/Temp" to your desktop, and that's precisely what my program needs to do. Its odd how easy i can preform drag and drop TO java, but not from java to the OS. Any Help is realllly greatly appreciated, and I'm open to other routs if anyone can think of some other way to drag a file from java to an OS.

Is This A Good Question/Topic? 0

Replies To: Drag Files to OS

#2 Dogstopper  Icon User is offline

  • The Ninjaducky
  • member icon



Reputation: 2872
  • View blog
  • Posts: 11,031
  • Joined: 15-July 08

Re: Drag Files to OS

Posted 06 February 2010 - 05:36 PM

If you are using a JFrame, you will find this tutorial very handy to help solving this issue. http://java.sun.com/.../dnd/intro.html

Unfortunately, with an applet, you have to get it signed to be able to access anything on a user's computer.
Was This Post Helpful? 0
  • +
  • -

#3 Guest_Guest*


Reputation:

Re: Drag Files to OS

Posted 06 February 2010 - 06:02 PM

View PostDogstopper, on 06 February 2010 - 04:36 PM, said:

If you are using a JFrame, you will find this tutorial very handy to help solving this issue. http://java.sun.com/.../dnd/intro.html

Unfortunately, with an applet, you have to get it signed to be able to access anything on a user's computer.



yes i have seen that, and no i already have that support. That helps you do Drag and Drop between Java programs, it has no connection from Java to an OS whatsoever. That will indeed help you drag text from a JLabel on one program to another java program, but it will not help me with dragging stuff from Java to an OS or windows explorer. Any other suggestions maybe? Because I'm really stuck by this point on where to proceed. There doesn't seem to be anyway for java to DnD to an OS from what i can tell.
Was This Post Helpful? 0

#4 painkiller102  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 15
  • View blog
  • Posts: 281
  • Joined: 27-February 08

Re: Drag Files to OS

Posted 06 February 2010 - 06:04 PM

last post was me by the way xD sorry, I have yet to adapt to the new forum setup >.<
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1