I have a Java application in an application bundle that has a file association (using Info.plist) that runs when a document is double-clicked. How do I get the filename of the document that was double-clicked in my Java application? Right now my Java app just runs and displays an empty document. There doesn't seem to be any command line arguments passed to the application.
Asked
Active
Viewed 2,164 times
1 Answers
1
I think you have to implement ApplicationListener or extend ApplicationAdapter and implement the handleOpenFile() method. See http://today.java.net/pub/a/today/2004/01/05/swing.html for a more elaborate explanation.

Simon Groenewolt
- 10,607
- 1
- 36
- 64
-
Some additional links that helped me solve this http://www.devdaily.com/blog/post/jfc-swing/java-handle-drag-drop-events-mac-osx-dock-application-icon http://developer.apple.com/mac/library/documentation/Java/Reference/1.5.0/appledoc/api/index.html http://forums.sun.com/thread.jspa?threadID=414409&forumID=316 – steve Oct 17 '09 at 21:09