• Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing app on Mac OSX, with desktop drag & drop  RSS feed

dave taubler
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question for any developers who write native Java apps targetted for Mac OSX...

In doing a some research for a separate issue, I discovered whereby you can register a com.apple.mrj.MRJOpenDocumentHandler with your application in order to receive a file that was dragged-and-dropped onto your application bundle within the desktop Finder. The code to do this is very simple; I implemented it the same way I've successfully implement MRJQuitHandlers, MRJPrefsHandlers and MRJAboutHandlers before. An additional step that apparently is needed is to add a declaration of the file types you can accept to your bundle's Info.plist file. I did that. But still, I try to drag a file of the declared type onto my application bundle... and nothing happens.

I suspect that something more needs to be done, especially because this article describes how, in addition to desktop drag-and-drop being enabled, your application's name should now start appearing in the contextual "Open" menus for files of the declared types. Surely, you must have to somehow register your application's new capabilities with the operating system. Does anyone know if there is such a step, and what it is? The article makes no mention of anything, but I suspect it's just an omission.

BTW, here is a link to the the article to which I'm referring:
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!