Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about file dropping on Java app



On 29-Mar-05, at 9:12 PM, Bob Hays, Computer Geek wrote:

Moving the listener to
near the start of the program did the trick (couldn't put it into a static
block without really messing with things - MRJAdapter doesn't seem to be
structured for that to me, but if someone has a suggested way to structure
the code blocks to get the Application done in a static block....).

Instead of using the net.roydesign.app.Application class, you can just call the static methods in net.roydesign.mac.MRJAdapter directly, like this:


import net.roydesign.mac.MRJAdapter;

public class MyApp
{
	static
	{
		MRJAdapter.addOpenDocumentListener(...);
	}
}

If your app is not ready when your listener gets called, you can stash the passed files into a class variable and at the end of your app initialization code, check if there is anything stashed to be handled.

Steve

--
Steve Roy <email@hidden>
Personal homepage: <http://homepage.mac.com/sroy>
Projects homepage: <http://www.roydesign.net>

_______________________________________________
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
References: 
 >Re: Question about file dropping on Java app (From: "Bob Hays, Computer Geek" <email@hidden>)



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.