Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Swing app on Mac OSX, with desktop drag & drop

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 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:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic