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.
1 Answer
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.
-
Some additional links that helped me solve this devdaily.com/blog/post/jfc-swing/… developer.apple.com/mac/library/documentation/Java/Reference/… forums.sun.com/thread.jspa?threadID=414409&forumID=316– steveOct 17, 2009 at 21:09