| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Hey chaps and chappesses, I'm currently working on trying to make our generic cross-platform Java Swing app a bit more Mac-like. I've done simple stuff like putting the JMenus in the menu bar (as opposed to in the JFrame), but I would really like to do something a bit more complex. Currently, I'd like to allow a file generated by our application (always either .rml or .pml extensions) to be dragged onto the app's Doc icon and it receive and load it. Our app is distributed using Java Web Start, so I can't do any of the fancy bundle creation stuff, which is where I sense you register what file types an app can receive. I'm currently at the stage of creating some cross-plaform specifics managers, so I can rationalise their use and keep all the OS specific stuff in one place. I've currently tried this: com.apple.eawt.Application.addApplicationListener(new ApplicationListener() { public void handleOpenFile(ApplicationEvent arg0) { String filename = arg0.getFilename(); if (filename != null) { arg0.setHandled(true); System.out.println("Opening file: " + filename); } else { arg0.setHandled(false); } } }); But the dock icon won't receive any file I try to drop on it, so I don't think this code gets called at all. Can anyone offer any advice? Thanks! Craig Pugsley PolicyMatter Phone: +44 (0)8702 403620 Email: email@hidden (work) Web: www.policymatter.com Made on a Mac |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden This email sent to email@hidden
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.