Java drag and drop woes

Joined
Feb 20, 2007
Messages
1
Reaction score
0
Points
1
I'm trying to get over some specific hurdles in a java swing program.

As a proof-of-concept, I made a jar that accepts files dropped onto the main window. Pretty simple, really. Just implement the DnD interface and you end up with a list of pathnames. Simple.

However, what I want to do is allow the user to drop the files onto the icon of my program and launch the program. Similar to dropping a file onto a printer icon and voila, it starts printing.

I can do this with windows by making a shortcut to "javaw.exe -jar DropTarget.jar", and the file names come in as command line parameters.- the args[] variable in main(String args[]).

This will not be a file type specific to my program- the user might drop in pdfs, text files, various binary files, etc.

Any thoughts?
 
Joined
Jun 3, 2009
Messages
2
Reaction score
0
Points
1
Same problem

I am trying to do the same thing. i Noticed that you posted this a while ago and was wondering if you ever found a solution to it.if you did can you please share! thank you!
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top