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: Application Startup Problem



Russ Calvert wrote:

>... My pseudocode is as follows:
>
>Display the zero size 'background' frame used to host the screen bar
>Create the com.apple.eawt.Application
>Add the com.apple.eawt.ApplicationListener
>if (no data files open) {
>        display file chooser
>}
>What seems to be happening is that the application events don't get
>processed immediately after adding the ApplicationListener, so that the
>'no data files open' test returns 'true' instead of 'false' as intended.

You should probably listen for and act only on an app-reopen event, or if a
certain time period passes after app-open and a file-open is not received.
In short, make the file chooser be event-driven.

It'd probably have to trigger an async thread, because opening a file
chooser on the ApplicationListener thread may well deadlock or do Bad
Things.  You could also queue up an action using invokeLater().

  -- GG


 _______________________________________________
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



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.